Force WWW or non-WWW

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]
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Selecting PHP version

Selecting PHP versions can be done by doing the following:hsphere Login to the control panel...

Frontpage Publishing via FTP

Frontpage extensions are not supported on our servers due to bugs in the extensions (some...

http Error codes

The following are http status and error codes that are returned for each file access via a web...

How to upload / create your site.

Creating your site How you create your site depends on what you want to do with it.  You...

SMTP Authentication via Scripts

Using SMTP authentication for your scripts, like you would with a mail client, is important for...