Installed nginx and php 5.6 on raspberry pi 2. We work perfectly, bypassing the fact that my pages are still loaded from xyz.com/index.php/whatever (WRONG), as well as xyz.com/whatever (PERFECT). I do NOT want /index.php to load my homepage. I want it to redirect / without index.php. This applies to all subfolders. What am I doing wrong?? This is the first server I've ever created, so any help would be appreciated. Thanks.
available conf sites:
server {
root /data/something.com/www/something/public;
index index.php index.html index.htm;
server_name something.com.local;
error_log /data/something.com/logs/error.log;
access_log /data/something.com/logs/access.log;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. {
deny all;
}
location ~ ^/(robots.txt|favicon.ico)(/|$) {
try_files $uri =404;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
error_page 404 /index.php;
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
Steve source
share