

To www or not to www? - stephenhuey

If you type google.com or facebook.com into a web browser, you're redirected to www.google.com and www.facebook.com respectively.  nasa.gov doesn't even resolve and you must type in www.nasa.gov to reach their website.  I've read up a bit on the history and preferences regarding the www subdomain, but what should we do now?  If you're setting up a website in 2012, would you forward the naked domain to www or not?
======
there
I make www resolve but just forward to the URL without it. I don't like the
way www looks and having to say it is annoying.

Whichever you pick, you should use that one and redirect the other to it, just
so there is one consistent set of URLs.

nasa.gov doesn't resolve because www.nasa.gov is a CNAME to Akamai hosts for
load balancing purposes, so they can't use the same thing for just nasa.gov
(and manually inserting A records would get out of date and not distribute
load properly). Google has the same setup (www is a CNAME), but because they
control all of the hosts that the CNAME resolves to, they can put those same
host records as google.com.

------
Rust
Personally, I either code so the site doesn't care if "www" is there or not
(watch your cookie domain though) or force a redirect to the non-"www" address
(particularly when I don't want to purchase 2 SSL certs for a domain).

A couple of years a go I would have said to keep the "www" - it's a subdomain
that refers specifically to the World Wide Web (or HTTP) address of a site, as
opposed to the FTP or email services.

Nowadays, I prefer to either drop or ignore the "www" - if you're using an
HTTP client to reach my domain, I'm going to go ahead and assume you want the
website and not the FTP site. Intelligently named subdomains are good for
organization :)

So either make both work, or redirect one to the other. It really doesn't
matter very much either way.

------
michaelmior
I would go with www and redirect anything without www to www. I used to be
against this, as the www is mostly unnecessary. However, if you ever want to
serve static assets at a subdomain of your site, this is a big win.

The reason is that any cookies you set for the root domain (without www) will
be sent on each request to any subdomain. So if you want to server images from
images.domain.com, you'll get all the login, tracking, etc. cookies sent along
with each request. 99% of the time, this is wasted bytes.

You could argue that the widespread use of CDNs for static content makes this
point irrelevant, and perhaps you're right.

------
dchest
<http://news.ycombinator.com/item?id=2575266>

<http://news.ycombinator.com/item?id=1758865>

------
manuscreationis
I would say you should choose to use one or the other, and redirect a user to
the one you intend to use.

Simple as that

