Reputation: 719
I have an NGINX rewrite that looks like this:
if ( $uri !~ ^/(index\.php|index|css|img|fonts|js|robots\.txt|favicon\.ico|slick) ) {
rewrite ^(.*)$ $1.php;
}
Basically it's supposed to remove .php extensions from all files that are not contained in css, img, fonts etc. It works fine, but this prevents my index.php
file from showing when accessing /
. To me, these rewrites are complete chinese, therefore, i cannot figure it out. Can anyone tell me, why this happens?
Upvotes: 2
Views: 54
Reputation: 49692
You are probably rewriting /
to /.php
. You could make your rewrite a little more selective with:
rewrite ^(/.+)$ $1.php;
Upvotes: 2