How do I redirect all visitors to the “www” version of my website (or vice versa)?

This page is showing a generic answer.
To see a more detailed answer customized for you, type your domain name here:

Our Web servers are configured so that visitors to your website will see the same content whether they type example.com or www.example.com in their browser's address bar. You can tell other people whichever one you prefer; they'll both work (although we recommend using www.example.com if you have the choice, because it avoids certain potential problems in the future).

Some website owners want to make sure that only one address is used. For example, if a visitor goes to example.com, you may want them to be automatically redirected to www.example.com, or vice versa.

You can do this with our service — just choose one of the following four options

Keep in mind that these rules will redirect all requests for any file type on your website (including images), not just requests for Web pages.

Option 1: Redirecting example.com/dir/anypage.html to www.example.com/dir/anypage.html (same page)

Use this format if you want a request for any URL at example.com to redirect to the same page at www.example.com. (If you want to redirect to the home page of www.example.com, see option 2 below.)

  1. Login to the “My Account” control panel (having trouble?)
  2. Click Redirections
  3. Click Add New Redirect
  4. Choose the option to Redirect to or from “www”
  5. Make the rule be “When a request arrives for hostname example.com: Redirect it to the same page of https://www.example.com” (change “https” to “http” if your site does not use SSL)

Option 2: Redirecting example.com/dir/anypage.html to the www.example.com home page

Use this format if you want a request for any URL at example.com to redirect to the home page of www.example.com. (If you want to redirect to the same page at www.example.com, see option 1 above.)

  1. Login to the “My Account” control panel (having trouble?)
  2. Click Redirections
  3. Click Add New Redirect
  4. Choose the option to Redirect to or from “www”
  5. Make the rule be “When a request arrives for hostname example.com: Redirect it to the top level of https://www.example.com” (change “https” to “http” if your site does not use SSL)

Option 3: Redirecting www.example.com/dir/anypage.html to example.com/dir/anypage.html (same page)

Use this format if you want a request for any URL at www.example.com to redirect to the same page at example.com (which we usually don’t recommend).

  1. Login to the “My Account” control panel (having trouble?)
  2. Click Redirections
  3. Click Add New Redirect
  4. Choose the option to Redirect to or from “www”
  5. Make the rule be “When a request arrives for hostname www.example.com: Redirect it to the same page of https://example.com” (change “https” to “http” if your site does not use SSL)

Option 4: Redirecting www.example.com/dir/anypage.html to the example.com home page

Use this format if you want a request for any URL at www.example.com to redirect to the home page of example.com (which we usually don’t recommend).

  1. Login to the “My Account” control panel (having trouble?)
  2. Click Redirections
  3. Click Add New Redirect
  4. Choose the option to Redirect to or from “www”
  5. Make the rule be “When a request arrives for hostname www.example.com: Redirect it to the top level of https://example.com” (change “https” to “http” if your site does not use SSL)

Aliases

We offer domain name aliases — an extra domain name that points to a separate Web hosting account.

Redirection is more complicated if you were using an alias since there would be two different domain names pointing to your website. The four sample options above wouldn't affect Web requests made via the aliased domain name directly.

To add them for the aliased domain name, simply login to the “My Account” control panel as the aliased domain name and repeat the same steps.