Skip to content

Instantly share code, notes, and snippets.

@brcontainer
Last active May 2, 2017 17:18
Show Gist options
  • Save brcontainer/c2b3c75439fa3e4905e9 to your computer and use it in GitHub Desktop.
Save brcontainer/c2b3c75439fa3e4905e9 to your computer and use it in GitHub Desktop.

Laravel 5 in Windows IIS

  1. Create a web.config file in laravel root diretory
  2. Put this content in web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
            </files>
        </defaultDocument>
        <rewrite>
            <rules>
                <rule name="Laravel Force public">
                    <match url="(.*)" ignoreCase="false" />
                    <action type="Rewrite" url="public/{R:1}" />
                </rule>
                <rule name="Laravel Routes" stopProcessing="true">
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <match url="^" ignoreCase="false" />
                    <action type="Rewrite" url="public/index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Laravel Force public">
<match url="(.*)" ignoreCase="false" />
<action type="Rewrite" url="public/{R:1}" />
</rule>
<rule name="Laravel Routes" stopProcessing="true">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<match url="^" ignoreCase="false" />
<action type="Rewrite" url="public/index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment