How do I add or remove www from my domain?

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


While some people prefer to not use "www" in their web site 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.

Adding or removing "www" in the panel

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

When 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:

01 Removing www from your domain.fw.png

The solution is to make sure the option in your DreamHost panel matches what you selected within the WordPress configuration. View the Change WordPress Site URL article for instructions on how to update this URL in WordPress.

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]
  1. Navigate to the (Panel > ‘Domains’ > ‘Manage Domains’) page.
  2. Click the Edit button to the right of your domain under the ‘Web Hosting’ column.
    01 Add a domain.png
  3. Select the radio button for ‘Add WWW’.
  4. Scroll down and click the blue Save changes button to save.

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

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 remove link mod_rewrite rule in your .htaccess file:

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

If someone types in, the URL now change to

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 "" to "" (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. View the following article for further information:

See also

Did this article answer your questions?

Article last updated .