Hello guys, i just wanted to share my nginx setup which includes removing the index.php part, so enjoy
server {
server_name site.com www.site.com;
root /var/www/html/forum;
index index.php;
location / {
#try_files $uri $uri/ =404;
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite /.(js|css|jpeg|jpg|gif|png|ico|map)(?|$) /404error.php last;
}
if (!-f $request_filename){
set $rule_1 1$rule_1;
}
if (!-d $request_filename){
set $rule_1 2$rule_1;
}
if ($rule_1 = "21"){
rewrite /. /index.php last;
}
}
location ~ \.php$ {
# remember to change this to your specific php version.
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}