Redirect ALL requests to single PHP file
nginx-forum at nginx.us
Wed Jan 18 16:35:24 UTC 2012
We'd like to redirect all requests to a single PHP file. The
configuration below is what we have but I'm concerned that it would
cause an "infinite" loop and possibly other problems. We'd like to
redirect ANY request to api.php regardless if the file exists or not.
Even a request to an existing static file should rewrite to the
Is this the correct way? is there a better way?
rewrite ^(.*)$ /api.php?uri=$1 last;
location ~ \.php$
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221398,221398#msg-221398
More information about the nginx