Rewrite all directory URLs with certain exceptions

Cristian Rusu crirus at gmail.com
Wed Nov 28 08:04:58 UTC 2012


Hello

I have urls like example.com/123
I need them rewritten to example.com/?v=123

However, I want to skip certain directories from rewrite
eg.
example.com/status
example.com/admin

right now I have this:

if (!-e $request_filename){
    rewrite ^/([A-Za-z0-9-]+)/?$ http://www.example.com/v.php?dl=$1redirect;
}

Problem is that all urls are rewritten.. how do I put some exceptions?

Thanks for any suggestion

---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing

======
Crilance.com
Crilance.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20121128/1d86534a/attachment.html>


More information about the nginx mailing list