httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Pasher <>
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 [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*
> 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.*

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 

RewriteRule ^/test/.*

Justin Pasher

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message