Nginx simulate multiviews in deep directorys -


i'm new in nginx, , i'm trying configure nginx rewrite deep directories php name of first directory in url. example:

http://domain.com/news/search/band/ -> news.php http://domain.com/article/blue/300/?arg=10 -> article.php?arg=10 http://domain.com/xxx/yyy/zzz/ -> xxx.php 

i tried regular expressions , with:

try_files $uri $uri/ @extensionless-php /index.php?$args =404; 

but haven't had success; me? thank

replying myself:

a lot of apache installations have multiviews enabled. can this, again, try_files directive:

location ~ ^(/.+)/ {     try_files $uri $1?$args $1.php?$args; } 

though not multiviews in apache do, (like making possible omit file extension), in php configurations 9 times out of ten need above behaviour, letting php file handle requests containing filename , slashes appended.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -