views:

375

answers:

5

Duplicate:

Should I default my website to www.foo or not?


To be quite honest, I'm ignorant as to what the differences between "http://example.com" and "http://www.example.com" are.

I typically always use the shorter version, without the "www," just for the sake of the length. But I know (think) that there can be cookie conflicts when users try to access a site when they alternate the version they're using. So on all of my sites I just have "http://www.foo.com/bar" redirected to "http://foo.com/bar". But is there anything to be said about using the "www"?

+7  A: 

www is just a subdomain like any other. There's nothing inherently special about it. Back when most of the interaction with the Internet was services other than HTTP, it made sense to have the HTTP traffic use a specific subdomain. Nowadays, the vast majority of domain names exist simply to serve up HTTP traffic, so the distinction is unnecessary. I think it's generally preferred to use the "shorter version" as you call it, and redirect www to the main domain.

rmeador
Good answer, but I recommend you mention the other protocols that you would see before the domain, like irc, ftp, whatever.
belgariontheking
It should be noted that when you redirect from the www hostname to the shorter one, you should use a 301 permanent redirect rather than 302 or 307.
Bob Aman
+2  A: 

The www subdomain is a reminiscence of the old times when you had an ftp subdomain for the FTP server and so on. There are no reasons to keep it. Many serious sites, including stackoverflow.com here even redirect www.site.com to site.com.

Andrei Rinea
I remember for a while websites would automatically redirect to the www by default, and now it seems like it's the other way around :)
TheTXI
+1  A: 

www is a subdomain and was typically used to separate a web server from other servers running on the same domain. Other subdomains can be used like ftp or irc.

Personally I think people still use it just to keep "compatible" and because a lot of people using the internet believe that www is actually part of the domain name itself.

Peter D
Good answer, but I recommend you mention the other protocols that you would see before the domain, like irc, ftp, whatever.
belgariontheking
+1  A: 

Yes, there can be cookie conflicts, and I've seen this numerous times on web forums.

As to the advisability of either approach, I can't really tell you that one is better than the other, but I CAN say that (in light of the aforementioned cookie issue), you should accept both but have one of them redirect to the other so that all URL's are going to use the same format.

Adam Robinson
+2  A: 

Just make the WWW a CNAME for the domain and direct all traffic to the domain name

trent