Humbly seeking pardon for asking a question which might be perceived
as offtopic to some.
This aspiring perl-guru needs to redirect requests for certain
directories (with the exception of some subtrees) to a different
webserver. Examples will make this clear.
Requests to http://server1/basedirectory should go to
http://server2/basedirectory
Likewise we need the following:
http://server1/basedirectory/something -> http://server2/basedirectory/something
etc.
However we need to omit some urls from the rule:
http://server1/basedirectory/exceptiondirectory1
and http://server1/basedirectory/exceptiondirectory2 (and their subtrees)
should stay on the same server and not get redirected.
We have apache 1.3.26 compiled with both mod_alias and mod_rewrite,
and we are currently using a very ugly solution to this problem,
the following rule:
RedirectMatch ^/basedirectory/([^e])(.*)$ http://server2/basedirectory
+/$1$2
This will will match our exception directories and then some extra unwanted
stuff too.
What I really want is something like what perl supports. Is
there a way to do something like the following:
RedirectMatch ^/basedirectory/(?!exceptiondirectory1|exceptiondirector
+y2)(.*)$ http://server2/basedirectory/$1$2
Thanks in advance to any who can advise me,
Rohit