httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Poling <jpol...@moody.edu>
Subject RE: [users@httpd] Rewrite rules
Date Tue, 04 Jan 2011 18:06:58 GMT
Jim,

Thank you.  That worked really well.

As a side note, are there resources you would recommend to help me with this type of task?

Jeff

Jeffrey Poling
System Administrator | Information Systems
Moody Bible Institute
820 N. LaSalle Blvd., Chicago, IL 60610
312-329-8968
www.moodyministries.net
>From the Word. To Life.


-----Original Message-----
From: Jim Riggs [mailto:apache-lists@riggs.me] 
Sent: Tuesday, January 04, 2011 10:53 AM
To: users@httpd.apache.org; Jeff Poling
Subject: Re: [users@httpd] Rewrite rules

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:
> 
> http://www.mydomain.com/site/test
> 
> I want to rewrite it as https://www.mydomain.com/site/test
> 
> 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: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


---------------------------------------------------------------------
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