httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Pasher <>
Subject Re: [users@httpd] Using .htaccess to force rewriting URLs to https:// works but loses any subdirectory paths. What do I need to change?
Date Mon, 15 Jun 2009 22:49:17 GMT
Bob Linkonij wrote:
> Ok, so I changed
>    RewriteCond %{HTTPS} !=on
> -  RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}/$1 [R,L]
> +   RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
> in the .htaccess file.
> But still when I go to
> I get redirected to

Hmmm... I'm not seeing anything obvious (this is the same type of code I 
use to redirect URLs on my servers, albeit based upon the host name 
provider, not HTTP vs HTTPS). I normally set this kind of thins inside 
the apache conf (in the VirtualHost container) because rewrite rules 
work slightly different in apache conf vs .htaccess, but it shouldn't be 
affecting this situation.

A couple of things to try:

1) Change the RewriteRule to this (just to make sure it's really 
processing and matching it)

RewriteRule (.*) https://%{SERVER_NAME}/this-page-is-bad [R,L]

2) Try cranking up the RewriteLogLevel a bit to see the rewrites in 
action, once again to make sure it's processing properly.

3) Make sure you clear your browser cache. I've seen odd instances where 
a browser might cache a redirect.

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