Search code examples
httpwebhttp-redirectno-www

www.domain.tld vs. domain.tld


TL;DR Should I redirect from www.domain.tld to domain.tld or vice versa?

I am running a CMS that handles multiple domains. Until now the CMS is in charge of redirecting www.domain.tld to domain.tld or vice versa for each domain individually, but I've decided to let mod_rewrite handle that in the future for some reasons:

  • Performance: No need to fire up the CMS just to serve a http-redirect
  • Consistency: For "historical reasons", some domains do the redirect in one directions and some do it in the other direction. That's not a real problem, just gives me an itch.
  • Simplicity: Instead of having to worry about each domain individually, I'll have a solution for all existing and future(!) domains, even those that are not handled by the CMS.

I know how to implement that, but what I don't know is if there's a preferred "direction" of the redirect. I found very little information on that subject, but maybe I just searched for the wrong stuff. I remember having read somewhere (I believe at some page of Google's webmaster tools, but I can't find it right now), that it doesn't matter which one you choose as long as you stick to it.

Personally, I prefer domain.tld over www.domain.tld, that's how I type it in my browser, that's how I say it and that's how I write it, because I think that "www." is unnecessary garbage that looks bad, sounds bad, costs time (to read, to write or in a verbal conversation), space (in your address bar or when printed on paper) and bandwidth (I know, 4 bytes, but those 4 bytes accumulate).

But to be sure, I went to see how others do it and all the big "internet companies" (Google, Facebook, Yahoo, eBay, Amazon) as well as Apple and Microsoft redirect to www.domain.tld. Sites that cater to a more technical audience are split up: icann.org and w3.org redirect to the www version while for example jquery, github, stackoverflow redirect to the non-www version. In fact stack overflow's description of the 'no-www' tag says this:

The process of eliminating the usage of www to prefix URLs, for instance by redirecting users from http://www.example/ to http://example/. www is by many considered a dead and unnecessary practice.

So, are there any good reasons to prefer one over the other except the ones I already mentioned for getting rid of 'www.'? Or is it just a matter of personal taste and my findings are just a strange coincidence?

Side question

Not really a part of my current problem, but I noticed something intriguing and I'm curious: If there's https involved, most sites that I checked will handle it like this:

http://domain.tld -(301)-> https://domain.tld -(301)-> https://www.domain.tld

However Paypal uses a 301 only for the second redirect and 302 for the first and Apple (iCloud) does it with just one redirect:

http://icloud.com -(301)-> https://www.icloud.com

Can anyone think of a reason for doing this one way or the other?


Solution

  • OK, so apparently my research was sloppy and I posted this question on the wrong part of the vast stackexchange network.

    If anyone should stumble upon this question, looking for some answers, I found all the answers and links to further materials on Webmasters:

    Should I include “www” in my canonical URLs? What are the pros and cons?

    and there's also a related thread on meta:

    Why isn't stackoverflow using www in the URL?