Should I have both example.com and www.example.com?

5,960

Solution 1

UX Importance

User Experience also known as UX remains one of the most important factors when managing and operating a website. User experience enhances your conversions, increases time spent on page and indirectly improves rankings due to an increase of people wanting to link to your website.

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.

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 major 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.

Solution 2

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.

Solution 3

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:
5,960

Related videos on Youtube

Erel Segal-Halevi
Author by

Erel Segal-Halevi

I am a faculty member in Ariel University, computer science department. My research topic is Fair Division of Land. It is related to the classic problem of fair cake-cutting, which is a multi-disciplinary topic connecting mathematics, economics and computer science, I am always happy to discuss any topic related to land division or fair cake-cutting. If you have a new idea in these topics and need a partner for brain-storming, feel free to email me at [email protected]. The answers I receive in the Stack Exchange websites are very useful, and I often cite them in papers. See my website for examples.

Updated on September 18, 2022

Comments

  • Erel Segal-Halevi
    Erel Segal-Halevi over 1 year

    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?

    • Admin
      Admin almost 10 years
      It should be easy enough to add a url dns record for www.
    • Admin
      Admin almost 10 years
      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.
    • Admin
      Admin almost 10 years
      Simply because www is a sudomain of the domain.com so it is wise to keep it alive
  • RichardB
    RichardB almost 10 years
    Good answer. I'd also add that users may have already bookmarked the wrong url for another UX reason.
  • Erel Segal-Halevi
    Erel Segal-Halevi almost 10 years
    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?
  • Stephen Ostermiller
    Stephen Ostermiller almost 10 years
    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.
  • Håkan Lindqvist
    Håkan Lindqvist almost 10 years
    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).
  • Erel Segal-Halevi
    Erel Segal-Halevi almost 10 years
  • apscience
    apscience almost 10 years
    Regarding SEO Importance: actually that's not correct anymore -- most search engines map no-www to the www entity.
  • Simon Hayter
    Simon Hayter almost 10 years
    @ErelSegalHalevi I've updated my answer regarding the DNS. If you need a more specific detail on adding the DNS records then please reply in a comment with which registrar holds your domain ;)