When you fully host your domain with IntechCloud, you have the option to add the ‘www’ subdomain in front of it, leave it off entirely, or allow both options. For example:

  • www.example.com
  • example.com

While some people prefer to not use "www" in their website URL, some prefer that it always be there. Either way, it can sometimes be useful to have a single canonical name by which your site can be accessed. This article details how to do both.

This option creates a 301 redirect.

  1. Navigate to the Manage Domains page.
  2. Click the Edit button to the right of your domain under the Web Hosting column.
    The ‘Manage Domain’ page opens:
  3. Select one of the three options next to ‘Do you want the www in your URL?’:
    • Leave it alone: Both www.example.com and example.com will work.
    • Add WWW: Forces all requests to add www (i.e., all requests to example.com go to www.example.com).
    • Remove WWW: Forces all requests to remove www (i.e., all requests to www.example.com go to example.com).
  4. Scroll down and click the Change settings button to save.

Within about 10 minutes, your site will redirect to the ‘www’ version of the URL.

Adding or removing "www" using an .htaccess file

If you do not want to use the panel option, you can still add or remove 'www' using an .htaccess file.

This involves creating and editing this file on your web server. View the following articles for further instructions:

Removing "www" through an .htaccess file

To automatically remove the www from the beginning of your domain, add the following mod_rewrite rule to your .htaccess file. If you don't have that file, create it in a text editor and then upload it to your root directory:

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

Forcing the ‘www’ subdomain in an .htaccess file

To force the use of "www" when viewers are reading your site, you can use the following mod_rewrite rule in your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST}  !^www\.example\.com$ [NC]
RewriteRule ^(.*) http://www.example.com/$1 [L,R]

If someone types in example.com, the URL now change to www.example.com.

When adding or removing "www" breaks WordPress

WordPress is unique in that it requires the URL to either force www or remove www from the domain name. If your database is forcing www but your panel is forcing it’s removal (or vice versa), you’ll see a redirect loop error such as this:

There are two solutions to resolve this.

Option#1

Set the option above to Leave it alone.

Option #2

Make sure the option in your IntechCloud panel matches what you selected within the WordPress configuration. Additional information

  • While most domains configure their main web server to answer to both forms, most do not bother with this type of redirection from one to the other. Ultimately, as long as the content served is the same, it doesn't usually matter what name is used to get to a given site.
  • One consideration when deciding whether to redirect example.com to www.example.com (or vice-versa) is that of Search Engine Optimization (SEO). Many search engines blacklist sites that "mirror" their site (have the same content at multiple URLs) under different domains and/or subdomains. Spiders may not blacklist for a "www" mirror, but better to play it safe by picking one and redirecting the other to it.

Using www with Cloudflare

If your site is using the Basic Cloudflare plan in the panel, you must force the URL to redirect to the www version. 

Was this answer helpful? 33 Users Found This Useful (37 Votes)