Answer the question
In order to leave comments, you need to log in
How to remove .php at the end of page URLs?
NGINX how to remove .php at the end of page URLs?
Answer the question
In order to leave comments, you need to log in
Thanks https://toster.ru/user/Wheelie everything works.
maybe someone will be interested, here is such a config turned out.
server {
listen 80;
server_name test;
location / {
root /test/www;
try_files $uri $uri.html $uri/ @extensionless-php;
index index.php;
}
location ~ \.php$ {
root /test/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question