Is the www in web addresses a subdomain? [duplicate]

Possible Duplicate:
Whats the purpose of the WWW subdomain?

I read about sub domains at w3schools, but Wikipedia says something different. The w3schools gave the example of www being a sub domain. Is the www before the website the subdomain or the subaddress inside a domain (as wikipedia mentioned)?


To add to that the reason many sites use the www. subdomain is that it allows for simple segregation in the file structure of the site. Everything in the www folder (and at the www.example.com domain) is directly related to serving the site to the public. This allows for simple root level site organization so you could also have a dev folder and have a subdomain dev.example.com for your development site, and so on.

Now you not only know that it is in fact a subdomain, but also why.


Both articles are saying exactly the same thing.

example.com -> domain
foo.example.com -> subdomain

The foo is inseparable from the rest of the hostname (except when dealing with search domains, but that's a completely different topic).


A sub domain normally denotes separate content from the main website.

For example, if I go to foo.bar.com, I expect a different set of content from bar.com.

The www prefix is subtly different to a sub-domain. This is actually a canonical alias that normally points to the same content as the non www prefix.

So in real-world terms, "www" is not really a sub-domain as it does not contain a "sub section" of the website. Here are some examples...

www.bar.com or bar.com - the root of the website foo.bar.com - a sub-domain of the website

Part Two... should you use "www" prefix?

The answer to this question is "it depends". If your audience is the "general public", you'll find that they are more comfortable starting a web address with www. If you are dealing with savvy technical types, you can ommit the www - so you'll find Stack Overflow, Super User, jQuery and many other websites with technical audiences using the non-www address as their preferred URL. Also note, though, that if you type in the www by accident, you still get to the same page!

In short, "www" isn't really a sub-domain, it's an alias and you should use it if it is appropriate to your audience.

If you are thinking about this kind of stuff, you might find the W3C Style Guidelines a useful read!

http://www.w3.org/Provider/Style/