Redirect to HTTPS WWW - How Do I Achieve it?

#2
SOLVED: I managed to get in touch with Litespeed Support and here is the solution that gave me and it works. Edit the .htaccess file


Code:
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ https://www.%{SERVER_NAME}/$1 [L,R=301]
 
#3
My wordpress site is configured to work as https://www.domain.com
When appliying:
SOLVED: I managed to get in touch with Litespeed Support and here is the solution that gave me and it works. Edit the .htaccess file


Code:
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ https://www.%{SERVER_NAME}/$1 [L,R=301]


it adds www to every connection, therefore when https://www.domain.com is forwarded to https://www.www.domain.com

It code right? Should I change my wordpress main url to https://domain.com instead of current https://www.domain.com or is there somthing else for htaccess?
 

Cold-Egg

Administrator
#4
If the connection start with www, then it won't mach "RewriteCond %{HTTP_HOST} !^www." and will skip "RewriteRule ^(.*)$ https://www.%{SERVER_NAME}/$1 [L,R=301]"
 
Top