I don't know why my pages are not eachable without .php extension. Something is wrong ? However it work on another of my website
When I put try_files $uri $uri/ $uri.html $uri.php?$query_string;
it's ok for the .php files without extension, but my website create "fakes folders/pages" like mywebsite.lol/category/example - and now it's doesn't reachable (404)
Here is my server{}
block configuration.
# Gestion www
server {
# Port
listen 80;
# Hostname
server_name test.mywebsite.lol;
# Logs
access_log /var/log/nginx/test.mywebsite.lol.access.log;
error_log /var/log/nginx/test.mywebsite.lol.error.log;
root /home/mywebsite/www/test;
# Fichier a executer par defaut (en ordre)
index index.html index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\. {
deny all;
}
}