Answer the question
In order to leave comments, you need to log in
nginx, try_files and php?
Good evening, colleagues!
I need that when requesting http://hostname/dir
(namely, without a slash at the end), the search for files occurs in the following sequence:
1. $uri (in this case, dir without extension)
2. $uri/index.php (dir/index.php)
3. / index.php
This works, but a slash is added to the end
. And if I do this, it does not process the PHP script dir/index.php, but offers to save it. Although the rest of the scripts are processed fine
Thanks
Upd: similar question on StackOverflow , but there is no answer (or rather, it is, but not the way I need it) try_files $uri $uri/ /index.php
try_files $uri $uri/index.php /index.php
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