Rewrite all directory URLs with certain exceptions

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


I have urls like
I need them rewritten to

However, I want to skip certain directories from rewrite

right now I have this:

if (!-e $request_filename){
    rewrite ^/([A-Za-z0-9-]+)/?$$1redirect;

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

Thanks for any suggestion

Cristian Rusu
Web Developement & Electronic Publishing

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list