Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I remember reading ages ago that it's a good idea to choose either www.domain.com or domain.com as your main URL and then set the other one as a 301 redirect to point to your domain?

The reason provided was:

  1. Some people may link to www.domain.com
  2. Other links may point to domain.com

In order to not lose 'SEO link juice', the individual recommended setting up a 301 redirect from one to the other.

Has this changed? Is it true? I would have guessed that Google (and other search engines) would be smart enough to whack some code in their algorithm to understand that in most cases www.domain.com = domain.com?

share|improve this question
Are you only interested in Google (as your last sentence implies)? Then you should add the tag google. – unor Jun 7 '13 at 14:23
I'm interested in all search engines with a slight preference to Google. Hence, I'll leave it without the tag. – James Spittal Jun 11 '13 at 5:48
up vote 2 down vote accepted

The main reason to redirect no-www to www (or the contrary) is to avoid duplicate content issues and not to avoid losing link juice. If you don't apply a 301 redirect, Google is going to index both versions of your website and will identify duplicate content (bad for SEO for sure).

Moreover, you can choose 301 redirect instead of rel="canonical" to avoid to lose link juice but just few of webmasters or users will be wrong on putting your URL on their websites.

share|improve this answer
+1 for using a 301 redirect from www.example.com -> example.com. Thanks and fixed it by adding a VirtualHost in Apache. serverfault.com/questions/120488/… – James Spittal Jun 7 '13 at 0:37

Yes it is true and no it hasn't changed. You should set a redirect from one to the other, or use the canonical tag to reference the canonical URL. (on this page they use an example of a URL with and without www).

As you mention Google is pretty smart and is usually quite good at figuring this out, but I often still see Google indexing both versions of URLs (with and without www prefix) when they are clearly the same page.

So you shouldn't leave it to chance and you should always make it clear which are your canonical URLs.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.