httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <m...@catseye.org>
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 <ntkach@gmail.com> 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 ^https://mycom.com/specialsale
> https://mycom.com/content/some/url/page.html
>
>
> 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
   mark@catseye.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