Alvaro
Alvaro

Reputation: 41595

"No input file specified" Laravel 4 on Windows with IIS7

After installing Laravel 4 on Windows 7 with IIS7 I'm having a problem trying to access any route different than the main one (/public/).

Tryingn to access to this URL:

public/users/

Generates this output on the website:

No input file specified

Upvotes: 1

Views: 1238

Answers (1)

Alvaro
Alvaro

Reputation: 41595

The problem is on the URL rewriting.

A web.config file is needed instead of the current .htaccess file located in the public folder of Laravel.

It can be created it by importing the .htaccess file into the IIS7 Rewrite Module: enter image description here

After applying the changes a web.config file will be generated in the main Laravel folder. Then it just needs to be moved into the public folder.

This is the content of the web.config file in case you want to generate it by yourself instead of using IIS7 for it:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Upvotes: 2

Related Questions