Community

HTTP to HTTPS WWW ? How do I achieve it?

Nu
Numeriku #3

HTTP to HTTPS redirect

RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]

Canonical www redirect

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.%{HTTP_HOST}/$1 [R,L]

Place on .htaccess file near the top. Make sure to restart your webserver.

de
deewinc #4
# HTTP to HTTPS redirect RewriteCond %{SERVER_PORT} 80 RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]

Canonical www redirect

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.%{HTTP_HOST}/$1 [R,L]

Place on .htaccess file near the top. Make sure to restart your webserver.

Thanks for you response. LiteSpeed support gave me the second option it works perfectly.

Sign in to reply