Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting up laravel on IIS7

I want to set up my IIS7 server in order to let it works with a web application written in laravel (php framework).

I found something similar for CI (link)

but it doesn't work on laravel (of course I removed the index.php redirection).

actually only home page works (www.mysite.com/public)

anybody uses/d IIS7 with Laravel?

thanks in advance

like image 434
Dario Rusignuolo Avatar asked Dec 01 '22 22:12

Dario Rusignuolo


1 Answers

I created the web.config file in root folder inside <configuration></configuration>:

<system.webServer>
    <defaultDocument>
        <files>
            <clear />
            <add value="index.php" />
            <add value="default.aspx" />
            <add value="Default.htm" />
            <add value="Default.asp" />
            <add value="index.htm" />
            <add value="index.html" />
        </files>
    </defaultDocument>
    <handlers accessPolicy="Read, Execute, Script" />
    <rewrite>
        <rules>
            <rule name="Imported Rule 2" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                </conditions>
                <action type="Rewrite" url="public/{R:1}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

then copy the index.php file of the public folder into the root folder of the project modifying the ../paths.php into paths.php as this guide says

now everything works perfectly

like image 155
Dario Rusignuolo Avatar answered Dec 16 '22 18:12

Dario Rusignuolo