Welcome! Log In Create A New Profile

Advanced

index.php not found (404) as index but when explicitely provided (url)

Posted by binaryanomaly 
index.php not found (404) as index but when explicitely provided (url)
July 31, 2013 05:50PM
Hello

I'm facing the a bit strange problem that when I open mysite with www.mysite.com/index.php everything works fine.
When I do the same with just www.mysite.com I get a 404 not found.
It used to work when I was using index.html. What is causing this? I'm a bit lost as I find no hints in the logfiles.

Relevant config-sections:

server {
...
index index.php;
...
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# # With php5-fpm:
root /var/www/retohaeberlicom/public_html/;
fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
include fastcgi_params;
}
}

Any ideas what could cause this behaviour or where I should look for config mistakes?

Thanks a lot.
Re: index.php not found (404) as index but when explicitely provided (url)
July 31, 2013 06:10PM
ok I think I found it, had to change

try_files $uri $uri/index.html =404;

to:

try_files $uri $uri/index.php?q=$uri&$args;

in location / {}

No idea why it doesn't like the =404 anymore...?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 282
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready