httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Pasher <just...@newmediagateway.com>
Subject Re: [users@httpd] Question on mod_rewrite
Date Thu, 06 Nov 2008 20:00:17 GMT
Charles Payne (Travel Channel) wrote:
> Guys,
>
> I have an issue that I can seems to find online. I have a mod_rewrite 
> rule that looks like this
>
> RewriteRule ^/test      http://myother.webserver.com [R]
>
> But what I want to do is anything that is a part of the directory 
> /test I want it to go to the other server.
>
> Can I do something like thing
>
> RewriteRule ^/test* http://tdocs.travelchannel.com/teams/Login.do
>
> Sorry this might be an easy question but I can seem to find a straight 
> answer on google.
>
> Thanks

The first component of a RewriteRule is a regex, so something like this 
should get you there (you were close).


RewriteRule ^/test.* http://tdocs.travelchannel.com/teams/Login.do

Now, this will redirect anything that starts with /test, so if you want 
to make sure the request is a directory, you can make it stricter as 
follows:

RewriteRule ^/test/.* http://tdocs.travelchannel.com/teams/Login.do


Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message