Answer the question
In order to leave comments, you need to log in
Why after deleting the file extension php is not processed?
I wanted to remove the .php file extensions from the URL , I spied on the solution - I wrote the following in the /etc/nginx/sites-available/default file :
location / {
# Удаляем .php
rewrite ^(/.*)\.php(\?.*)?$ $1$2 permanent;
# Удаляем закрывающий слэш
rewrite ^/(.*)/$ $1 permanent;
# Определяем порядок файлов для обработки запроса
try_files $uri/index.php $uri.php $uri/ $uri =4$
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question