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... The error is
Error 310 (net::ERR_TOO_MANY_REDIRECTS)
as if the redirections loops themselves...
any ideas?
Thanks!
Maybe try it without the question mark?
Edit: I wonder if its just hitting some sort of loop, maybe try external redirection