httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Riggs <>
Subject Re: [users@httpd] Rewrite rules
Date Tue, 04 Jan 2011 16:52:47 GMT
On Jan 4, 2011, at 10:22 AM, Jeff Poling wrote:

> I am very new to apache configuration, having inherited responsibility for it this fall.
 I need some assistance with (hopefully) a simple rewrite rule.
> We are using apache in a reverse proxy configuration.  For a URL like:
> I want to rewrite it as
> The trick is that "site" could be any number of different strings.  What regular expression
do I need to use to make this work?

If it's a fixed list, something like this should work:

RewriteCond %{HTTPS} !=on
RewriteRule "^(/(site|foo|bar|baz)/test.*)$" "https://%{HTTP_HOST}$1" [NC,R,L]

Or, for /<anything>/test:

RewriteCond %{HTTPS} !=on
RewriteRule "^(/[^/]+/test.*)$" "https://%{HTTP_HOST}$1" [NC,R,L]

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