I'm new in nginx, and I'm trying to configure nginx to rewrite deep directories to php with the name of the first directory in the url. For 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 with some regular expressions and with:
try_files $uri $uri/ @extensionless-php /index.php?$args =404;
But I haven't had success; could someone help me? Thank you