views:

956

answers:

8

Notice how the default domain for stackoverflow is http://stackoverflow.com and if you try to goto http://www.stack.... it bounces you to http://stack... ?

What is the reason for this? Not the tech reason (as in the http code, etc) but why would the site owners want to do this?

I know it's purely aesthetic and I always have host-headers for both www and not, but is there a reason to bounce a user to a single domain, subheaded or not?

Update 1

Not having a subdomain is called a bare domain. Thanks peeps! never knew it had a term :)

Update 2

Thanks for the answers so far - please note I understand that www.domain.com can point to domain.com. This is not a question about if i should offer both or either/or, it's asking why some sites default to a baredomain instead of www subdomains, or vice-versa. Cheers.

Jeff Atwood actually HAS explained why he's gone for bare domains here and here. (Nod to Jonas Pegerfalk for the post :) )

Jeff's post (and others in this thread) also talk about the problems of a bare domain with cookies and static images. Bascially, if you have cookies on in a bare domain, then all subdomains are forced also. The solution is to purchase another domain, as posted by the Yahoo Perf Team here.

A: 

Hi, actually you can use both of them. So it's better to find user your address or some. I mean actually it doesn't really matter tho :)

But putting www as a prefix is more common in public so I guess I'd prefer to use www behind it.

Braveyard
+8  A: 

as far as I can tell, it doesn't really matter, but you should pick one or the other as the default, and forward to that.

the reason is that, depending on the browser implementation, www.example.com cookies are not always accessible to example.com (or is it the other way around?)

for more discussion on this, see:

in favor of www

  • http://faq.nearlyfreespeech.net/section/domainnameservice/baredomain#baredomain - This webhost lists several good reasons for anyone considering doing more than simple webhosting to consider (such as load balancing, subdomains with different content, etc.)

  • http://yes-www.org - This blog post from 2005 mainly proposed that most internet users needed the www prefix in order to recognize a URL. This is less important now that browsers have built-in searching. Most computer illiterates I know bypass the URL bar entirely.

in opposition to www

and a miscellaneous related rant about why www should not be used as a CNAME, but only as an A RECORD.

qyb2zm302
Also, http://yes-www.org/ link doesn't work :(
Pure.Krome
I knew of no-www.org and just grabbed yes-www.org from its front page on a whim.edited the initial response accordingly.
qyb2zm302
That's some irony that http://yes-www.org is actually a valid URL! :P
Noldorin
A: 

It's easier to type google.com than www.google.com, so give the option of both. remember, the www is just a subdomain.

Also no www is a commonplace these days, so maybe make the www.foo.com redirect to foo.com.

Jonathan C Dickinson
It's even easier to type "google <Ctrl-Enter>", which adds both "www." and ".com" in most(?) browsers.
Andrew Coleson
@Andrew, I guess you are right :). Still it is more 'fashionable' to not have a www.
Jonathan C Dickinson
+2  A: 

In some cases, www might indeed point to a completely separate subdomain in a large corporate environment. Especially on an internal network, having the explicit www can make split DNS easier if the Web site is hosted externally (say, at Rackspace in Texas, but everything else is in your office in Virginia.) In most cases, it doesn't matter.

The important thing is to pick one and add an IHttpModule, rewrite rule, or equivalent for your platform to permanently redirect requests from one to the other.

Having both can lead to scary certificate warrnings when switching from http to https if you don't have a wildcard certificate and forget to explicitly redirect based on your site's name (which you probably don't because you want your code to work in both dev and production, so you're using some variable populated by the server).

Much more importantly, having both accepted results in search engines seeing duplicated content--you get dinged for having duplicated content, and you get dinged because your hits are getting split across two different URIs, hurting your rankings.

Nicholas Piasecki
A: 

I think one reason is to help with search rankings so that for each page only one page is getting rankings instead of being split between two domains.

Mike Henry
A: 

I'm not sure why the StackOVerflow team decided to use only one, but if it were me, I'd do it for simplicity. You'd have to allow for both since a lot of people type www by default or out of habit (I'm sure less "techy" people have no idea that there's a difference).

Aside from that, there used to be a difference as far as search engines were concerned and so there was concern about having either a duplicate content penalty or having link reputation split. But this has long since been handled and so isn't much of a consideration at this point.

So I'd say it's pretty much personal preference to keep things simple.

Jared
+2  A: 

It is worth noting that you can't have CNAME and an NS record on the same (bare domain) name in DNS. So, if you use a CDN and need to set up a CNAME record for your web server, you can't do it if you are using a bare domain. You must use "www" or some other prefix.

Having said that, I prefer the look of URLs without the "www." prefix so I use a bare domain for all my sites. (I don't need a CDN.)

When I am mentioning URLs for the general public (eg. on a business card), I feel that one has to use either the www. prefix or the http:// prefix. Otherwise, just a bare domain name doesn't tell people they can necessarily type it into their browser. So, since I consider http:// an ugly wart on a business card, I do use the www. prefix there.

What a mess.

Greg Hewgill
+10  A: 

Jeff Atwood has written a great article about the The Great Dub-Dub-Dub Debate. There is also a blog entry in the Stackoverflow blog on why and how Stackoverflow has dropped the www prefix.

Jonas Pegerfalk