Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I used to have a website which could be addressed by both example.com and www.example.com leading to the same page.

Now, I moved to another server and only the example.com works.

I got an email from Googlebot complaining that it cannot access www.example.com.

I know I can make www.example.com point to example.com, but do I really need it? Why not have only example.com?

share|improve this question
It should be easy enough to add a url dns record for www. –  krobertson Jul 13 '14 at 20:02
Systems administrators tend to automatically provide the www subdomain, and link it to a www sub-directory. This way, users can store data above this folder, without making it accessible through the web server. –  user43285 Jul 15 '14 at 11:21
Simply because www is a sudomain of the domain.com so it is wise to keep it alive –  Mohamed Anis Dahmani Jul 17 '14 at 19:19

3 Answers 3

up vote 23 down vote accepted

User Experience

User experience remains one of the most important factors when operating a website. User experience enhances your conversions, increases time spent on page and in directly improves rankings due to an increase of people wanting to link to your site. Having a site not accessible via both with or without www causes a few user experience problems, the biggest problem would be what if people manually type your domain with or without www directly into the address bar, a browser returning Server not found could loss you a site visitor and the less visitors you have the less chance of social mention and back linking opportunities.

So having a site that is not accessible by both means would definitely dampen user experience as well as missing out on SEO opportunities.

SEO Importance

Google and many other search engines reward websites that gain quality back links, should it be a blog link, a forum link or even a social mention all these typical examples are quality ways of easily increasing your website naturally. A website that receives a link to http://www.example.com but is only accessible typing http://example.com is not gaining any SEO value from that link. This is because Google only passes link credit to pages and websites that are accessible after-all who wants to click something to get ‘server not found’.

Solution Part 1 (Domain DNS)

You should proceed by setting up your domain DNS to work with both www.example.com and example.com, this can be found by either changing your name servers to that of the web server or pointing AA/AAAA record to the domain and the sub domain with www using a cname alias. This setup procedure differs from registrar to registrar.

Solution Part 2 (301 Redirecting)

You should redirect all site visitors and bots to the preferred version of your website of course this step isn’t required but it helps track visitors and backlinks gained are mostly likely to the preferred version, links received that are 301 redirected loss a minor amount of credit. Also redirecting some what does slow down the page loading because of the initial bounce.

If using Apache2 as your web server then I recommend checking out what are the most commonly used and basic Apache htaccess redirects or in the event you are using Windows Server IIS then you should check out Microsoft's URL rewrite extension.

Solution Part 3 (Optional Canonical Links)

It is recommended these days use canonical links to help search engines establish the page, if the site is accessible with and without www without a 301 redirect this step is pretty much a must as Google and other bots can mistakenly index your non preferred version. Also canonical links help prevent duplicate content unrelated to www so even without the topic of www or not www it’s a helpful thing to have because you may have content accessible on different sub paths never mind the sub domains.

share|improve this answer
Good answer. I'd also add that users may have already bookmarked the wrong url for another UX reason. –  Richard B Jul 13 '14 at 12:05
OK. Can you elaborate on the redirect issue? I read that it is possible to add a "CNAME" record to the DNS, such that "www" is redirected to "@" (which means a naked domain). Is this a good option for SEO? –  Erel Segal-Halevi Jul 13 '14 at 12:47
Redirecting www to the naked domain is a fine SEO solution. It requires more than just a DNS entry though. It also needs your webserver configuration to issue the 301 redirect. –  Stephen Ostermiller Jul 13 '14 at 12:50
It's worth emphasising that a CNAME record does not redirect anything. It makes one name into an alias of another name in DNS, i.e. these names will resolve the same (to the same IP in the case of an A / AAAA lookup). –  Håkan Lindqvist Jul 13 '14 at 17:32

You really do need to have the www. sub-domain point to your website. It is particularly important for type in traffic. If you tell a person to visit example.com, a large number of them will add a www. In my experience it is 40% or more that do this.

I myself tend to like naked domains with no subdomain when creating a website. I have occasionally neglected the redirecting www in the past. I almost always get a complaint from somebody that "your website doesn't work" and it is because they are adding the www. This is even the case when there is already some other subdomain like mytrip.example.com. Some people insist and accessing it like www.mytrip.example.com.

If Google is telling you that it can't access your site with www. it is likely because there are external links that point to it. If you want to keep those links working and retain any PageRank from them, you should support the www. subdomain.

share|improve this answer

Should you make www.example.com redirect to your site? Absolutely. Speaking from someone who works as a web developer and has an IT degree, if typing www.example.com didn't get me to your site, my first thought would not be to omit www. I'd think, "Oh, the site must be down." Or I'd think, "I must not have gotten the domain name correct. Maybe it's exaample.com. I'll google it."

If I was sure of the domain name, then my troubleshooting would stop at "Site's down." Maybe I'd try again the next day. If it still didn't work, I'd likely abandon my attempt completely.

My question is: why stop at redirecting www? Make your website as human-proof as possible. Your web server should allow for redirection of *.example.com. Do that. Then if a user types in ww.example.com or blog.example.com instead of example.com/blog, they'll still get to your site. You can do this without breaking existing subdomains. webmail.example.com can still work as intended.

Also, through the magic of IP filtering, you can make admin.example.com work on your internal network. On your external network, admin.example.com could redirect to example.com.

My general thought: if you know people might or probably will have a problem, why not solve it? And while you're at it, since it doesn't take more work, why not solve all related problems?

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.