From 00d8b84570854a0d5e917e2f02204afc0e9708df Mon Sep 17 00:00:00 2001 From: Nicolas Gryman Date: Tue, 2 Aug 2011 18:12:28 +0200 Subject: [PATCH] generic rewrite rules (working in virtual host context) --- .htaccess | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.htaccess b/.htaccess index a62acea8d946..132cd7e0c722 100644 --- a/.htaccess +++ b/.htaccess @@ -333,7 +333,7 @@ FileETag None RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] - RewriteRule ^(.*)$ http://%1/$1 [R=301,L] + RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] # ---------------------------------------------------------------------- @@ -346,8 +346,7 @@ FileETag None # # RewriteCond %{HTTPS} !=on # RewriteCond %{HTTP_HOST} !^www\..+$ [NC] -# RewriteCond %{HTTP_HOST} (.+)$ [NC] -# RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L] +# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # @@ -382,7 +381,7 @@ FileETag None # # RewriteCond %{SERVER_PORT} !^443 -# RewriteRule (.*) https://example-domain-please-change-me.com/$1 [R=301,L] +# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L] #