httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Linkonij <>
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 21:30:17 GMT
Hello Justin,

On Mon, Jun 15, 2009 at 2:22 PM, Justin
Pasher<> wrote:
>>        RewriteCond %{HTTPS} !=on
>>        RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
> You don't need to use REQUEST_URI (maybe it's not available in the context
> of RewriteRule?). You can just capture the results of RewriteRule match.
> RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

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

NOT the

Something else wrong with what I did maybe?


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