W
W
WebSpider2013-04-05 00:15:16
PHP
WebSpider, 2013-04-05 00:15:16

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

1 answer(s)
I
iStyx, 2013-04-05
@WebSpider

Place location ~ \.php$on the same level astry_files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question