Quantcast
Channel: What is the purpose of the WWW subdomain? - Super User
Viewing all articles
Browse latest Browse all 6

Answer by Andrew Moore for What is the purpose of the WWW subdomain?

$
0
0

It is mostly used to separate cookies from the other subdomains.

If you are going to use cookies, definitely keep the www..

You can always use an 301 redirect to redirect the short domain to the one with www., that way your users don't have to type it.

This will allow you to create sub-domains that are cookie-less for static data serving. Without a www., cookies are served on all sub-domains. Therefore, if you are not using the www., you need a completely separate domain name to have a cookie-less domain versus just using a sub-domain.

Other than that, choosing between keeping the www. or not is just a question on which one you prefer. Just make sure to redirect the one not chosen to the other one using a 301 redirect.

EDIT:

To explain, setting a cookie uses a hierarchy for how the cookie is propagated to domain.

For example, setting a cookie to example.com effectively allows the transfer of cookies to:

example.com
www.example.com
sub.www.example.com
my.example.com
oh.my.example.com
images.example.com
hello.example.com

Versus setting a cookie to www.example.com only allows the cookie in those situations:

www.example.com
sub.www.example.com

By using a www. you are allowing yourself to use sub-domains to have different cookies from the main site (and none at all if so desired).

Without www. (or another sub-domain), all cookies set on the domain will propagate to the sub-domains.


Viewing all articles
Browse latest Browse all 6

Trending Articles