Configure web.config

Hi,

My app giving error (404 not found) when try access route:

$app->get('/test/', function () { 
  echo "Hello, World! test"; 
}); 

But is ok, when try access:

$app->get('/', function () { 
  echo "Hello, World!"; 
}); 

.htaccess file is

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

Need configure Allowoverride All ?
how i can do it, using web.config IIS ?

The .htaccess file is what Apache uses for configuration. If you are using IIS, then follow the Web Servers, IIS section of the Slim docs.

1 Like

Hi, so i need use web.config in directory slim and this code? not using .htaccess ? sry im new in config web server… :slight_smile:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="slim" patternSyntax="Wildcard">
                    <match url="*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Correct, if you are using IIS and not Apache, you will not use the .htaccess and use the web.config instead.

PROBLEM SOLVED :slight_smile:

i believe was php (5.4.x) version and doctrine need (5.5.x +)