Apache rewrite to ignore certain directory and all its contents
- by Javier Novoa C.
Hi,
I'm looking for the rewrite rule for mod_rewrite in Apache so that when asking for a specific subdirectory, it and all its contents gets redirected to another location.
I currently have the following:
RewriteEngine on
RewriteRule ^/SUBDIRECTORY(/.*)? /another/location
But this only manages to redirect /SUBDIRECTORY requests to the desired location, while all others (like (/SUBDIRECTORY/ , /SUBDIRECTORY/anything/else ) gets me an error telling me that the redirection is not valid...
any ideas?
Thanks!