views:

995

answers:

3

Why do some websites require the "www" before the rest of the address, while others seem to resolve just as well with the "www" as without it?

Is there some compelling reason why you would set up your domain name to work like this?

A: 

There is no compelling reason, only ignorance.

Those are just mis-configured web servers.

To clarify comments: misconfigured as in requiring the www at the beginning and returning error when accessed without the www.

Alex Reitbort
like http://stackoverflow.com ?
caglarozdag
there are _plenty_ of compelling reasons, including not wanting all traffic for _other_ internet protocols to hit the same IP address
Alnitak
Only if the web is the central part of your internet presence. For domains that are primarily non-web, your assumption is not true.
bzlm
Even if you don't want them hitting it, you should still redirect HTTP traffic on domain.tld to www.domain.tld to avoid confusion.
Brian Cline
Yeah, just like you should redirect ntp traffic to ntp.domain.tld? Drink your lunch much?
bzlm
@caglarozdag: mis-cofigured as those that REQUIRE www and not working without it.
Alex Reitbort
@bzlm: what is connection between ntp and www? If teh web site requires www to be present at the start and returns an error when accessing it without it, it is misconfigured. You are loosing clients/users
Alex Reitbort
Heh, where did NTP come from? Really terrible analogy.
Brian Cline
+4  A: 

There are several reasons, here are some:

1) The person wanted it this way on purpose

People use DNS for many things, not only the web. They may need the main dns name for some other service that is more important to them.

2) Misconfigured dns servers

If someone does a lookup of www to your dns server, your DNS server would need to resolve it.

3) Misconfigured web servers

A web server can host many different web sites. It distinguishes which site you want via the Host header. You need to specify which host names you want to be used for your website.

4) Website optimization

It is better to not handle both, but to forward one with a moved permanently http status code. That way the 2 addresses won't compete for inbound link ranks.

5) Cookies

To avoid problems with cookies not being sent back by the browser. This can also be solved with the moved permanently http status code.

6) Client side browser caching

Web browsers may not cache an image if you make a request to www and another without. This can also be solved with the moved permanently http status code.

Brian R. Bondy
A: 

Hi,

Some sites require it because the service is configured on that particular set up to deliver web content via the www sub-domain only.

This is correct as www is the conventional sub-domain for "World Wide Web" traffic. Just as port 80 is the standard port. Obviously there are other standard services and ports as well (http tcp/ip on port 80 is nothing special!)

Imagine mycompany...

mx1.mycompany.com 25 smtp, etc

ftp.mycompany.com 21 ftp

www.mycompany.com 80 http

Sites that don't require it basically have forwarding in dns or redirection of some-kind.

e.g.

*.mycompany.com 80 http

The onlty reason to do it as far as I can see is if you prefer it and you want to.

Fraser