I have the following NGINX rewrite rule which works great for a PHP script installed in a subfolder:
location /subfolder/ {
if (!-e $request_filename){
rewrite ^/subfolder/(.*) /subfolder/index.php?do=/$1;
}
}
but Nginx wiki says using "if" is evil http://wiki.nginx.org/IfIsEvil so I tried the following
location /subfolder/ {
try_files $uri $uri/ /subfolder/index.php?$args;
}
but it doesn't work to replace the one above, although it works for WordPress and most of the PHP scripts. If there a way to translate it to use "try_files"?
Thank you!