httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <>
Subject Re: [users@httpd] Consequences of https to https rewrites?
Date Thu, 10 Nov 2011 20:23:51 GMT
On November 10, 2011 14:41 , Nick Tkach <> wrote:
> Been Googling all over
> trying to find details on any consequences/side-effects of using
> mod_rewrite to redirect secure urls to other secure urls on the same
> site.  Something like
> RewriteRule ^
> First of all, does that even make sense?  I'm a little fuzzy on the
> precise technical details of how SSL connections and http headers
> "mix".

You're complicating things too much.  In your HTTPS virtual host stanza 
in your web server configuration file, just put

RewriteRule ^/specialsale$ /content/some/url/page.html

The pattern for RewriteRule (the first argument) matches based on the 
URL path, not the URL.  The substitution for the RewriteRule (the second 
argument) can be a URL path, too, unless you need to redirect to a 
different site.

Unless you're doing something fancy, the fact that you are redirecting a 
HTTPS URL or that you are redirecting to another HTTPS URL are 
irrelevant.  There are no consequences or side effects that I am aware 
of.  And HTTP headers are generally independent of whether the 
connection is secured using TLS/SSL or not.

Where mod_rewrite becomes confusing is that when you use RewriteRule in 
a .htaccess file or Directory context, the pattern gets matched against 
the filesystem path with some prefix removed, not the URL path.  You can 
avoid this by putting your RewriteRules in virtual host or Location 
contexts.  Or, even better, if you don't need the power of mod_rewrite, 
use the Redirect and RedirectMatch directives instead, since these 
always use the URL path.

> Second, we've seen that at least sometimes that seems to generate a
> big spike in CPU usage "all of a sudden" once it goes live.

What seems to generate a big spike in CPU usage?  When what goes live?
   Mark Montague

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