There was a problem loading the comments.

Force WWW or non-WWW

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
NONE SSL

To force www in your URLs, place the following in the .htaccess.

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

To force non-www addresses, please use the following

RewriteCond %{HTTP_HOST} ^www\.
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]


SSL
To force www in your URLs, place the following in the .htaccess.

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

To force non-www addresses, please use the following

RewriteCond %{HTTP_HOST} ^www\.
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

Share via

Related Articles

© Cooini, LLC