With a little side of applesauce...

Tuesday, January 30, 2007

Apache rewriting a everything but one sub-folder

I had a request to rewrite a web to a new server, and found out after the fact that we needed to leave one subdirectory in place. Enter the power of mod_rewrite:

RewriteCond %{REQUEST_URI} !^/main/subweb1
RewriteRule ^/main/(.*) http://www.example.com/ [R]

What power!

No comments: