What is the purpose of the WWW subdomain?
Solution 1
Before the World Wide Web, there was still an Internet, and it was used for a variety of things: telnet, email, gopher, FTP, etc. At that time, it was traditional to assign domain name aliases to servers for common functions. So, smtp.example.com would be example.com's outbound email SMTP server, ftp.example.com would be example.com's FTP server, etc.
When the Web came along (early 1990's), it was just yet another application / protocol — it wasn't necessarily envisioned at that time that it would become the most popular thing to use the Internet for, next to email. So, an organization's web server was assigned a domain name alias of www. like any other service would have typically been assigned.
Over time many sites started dropping the www., because URLs are after all often typed in by people and yes it's 4 more characters than really necessary. But, www. still lingers today and it's not likely to ever completely go away.
Solution 2
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.
Solution 3
No idea if this is traditionally why www.
is used, but one possible reason:
Say you have a server which runs web, SMTP and IMAP servers. Users access the web server via www.example.com, SMTP via smtp.example.com and IMAP via imap.example.com
Your server becomes heavily loaded, so you want to split the web-server to a new machine. To do this, you simply change the "www" subdomain to point to your new web-server's IP address.
For larger internal networks, this is an easy way to move servers around.. Just change the internal SMTP server DNS entry and all clients will automatically start using the new machine. No forwarding of ports to worry about
With internet facing servers, you would probably keep both servers on the same NAT'd network, and forward port 80 to a different machine, or use a load-balancer
There are benefits to retaining the "www." part of the URL for purely web-servers, particularly with regards to cookies, as Andrew Moore and this blog.SO post explain.. Plus if you redirect the non-www domain, users don't have to type it (and even if you don't, most browsers will try "www.example.com" if "example.com" doesn't work)
Solution 4
It could be worse. The British parts company 'RS' seems to have fundementaly misunderstood the whole thing - their website is rswww.com
Solution 5
It's simply a matter of abstraction, like having bills addressed to "The Club Secretary" instead of "Susan". If you have bills sent to susan, and sales catalogs, and CVs, then what happens if you hire Bob to handle HR stuff like CVs? The mail is still addressed to Susan, and no one will know it's for Bob until Susan has found time to open it and make sure it's not meant for her. So instead of naming "Susan", the actual person, you name "Human Resource Department" -- the ROLE.
Likewise, you name computers for their ROLEs, not the actual computers. So you have a computer called www.yourcompany.com if you serve websites, and a computer called ftp.yourcompany.com if you provide an FTP service, etc. If you don't, then one computer, yourcompany.com, has to receive all the internet traffic, and then pass it on to the right place. www.yourcompany.com could be all the webservers at google, but if yourcompany.com is a laptop, the laptop will be overloaded, while the web servers will still be sitting around waiting for information to reach them. Like Susan handling all the mail initially, one computer can handle all the roles initially, but the separate computer/domain names help to separate (or consolidate) things as necessary.
Related videos on Youtube
mk12
Updated on September 17, 2022Comments
-
mk12 over 1 year
What's the point of having
www.
? Isn't it just useless extra text? Since everyone is used to it,www.google.com
looks more well-balanced thangoogle.com
, but why did it start in the first place?One thing I noticed, is that
google.com
has the IP of74.125.53.100
, in the UK, whilewww.google.com
has the IP of209.85.135.106
, in the US. Could anyone explain a bit on that?Edit: Is
example.tld
supposed to be a different machine thanwww.example.tld
? Does it have to be?-
Admin over 14 yearsNice question. I'm curious about abbreviating "world wide web" to something which (of course is shorter on paper/screen) is actually 3 times longer to say out loud. Maybe the only example of this in the English language. Other languages don't have this issue of course. Any good ways to simplify?
-
Admin over 14 years"www" usually is NOT a sub-domain--you're unlikely to see foo.www.example.com. Instead, "www" is often CNAME--an alias for some other physical machine.
-
Admin over 14 yearsIsn't a cname a type of subdomain?
-
Admin over 14 yearsYes,
www.
is a subdomain, and it does not matter if it's got its own address (A
/AAAA
) records or if it's simplyCNAME
d to somewhere else. It stays a subdomain. -
Admin over 14 yearsTechnically speaking, I think Dan may be correct: www would refer to a computer (a host) either directly (via an A record) or indirectly (via a CNAME record; an alias), so it would be a hostname, or a fully qualified domain name (FQDN). It could still be that subdomain is a general term for any domain name that has a parent domain though.
-
Admin over 14 yearsDoesn't the domain name point to the server/host?
-
Admin over 2 years@mk12 Only if you explicitly point it there in DNS. Most domains do as a matter of good practice, but it's not required or mandatory.
-
-
Lee B over 14 yearsHuh? www. was in use before cookies existed -- from the dawn of the web in fact -- as far as I know.
-
CNJ over 14 yearsYup, but now it’s a decent convention for keeping cookies separate if you end up using subdomains for separate sites.
-
outsideblasts over 14 yearsThat's some really good info about the application of cookies with subdomains, but I'm afraid it doesn't really answer the question of WHY the subdomains are used how they are.
-
outsideblasts over 14 yearsIn agreement with bm. The domain (eg google.com) handles many services and the www kind of says which service it is using (www, mail, smpt, pop, ftp...). Of course, as www traffic is probably the most common kind, servers will most likely know what is expected, and act accordingly. Many servers are configured to redirect traffic from (eg) google.com to www.google.com. One reason for this is that search engines often see google.com and www.google.com as different sites (which is bad, for reasons not relevant here). Sites leaving off the www are becoming more common eg superuser.com!
-
mk12 over 14 yearsSo the www means it is for the web, for the http protocol, and also to separate it from subdomains (for cookies), but now some servers (like superuser) are not using the www (although makng it redirect to the plain non-www) because they are only intended for that.
-
Andrew Moore over 14 years@Lee B: Because today, this is the only real reason why people keep using
www.
on new websites. There is no other technical reason whywww.
is still in use today. -
Martin Beckett over 14 yearsSince they are on different ports this isn't really an issue.
-
Lee B over 14 yearsSorry, disagree.
-
Lee B over 14 years@mgb: not an issue as far as you're concerned, is what you mean. Some of us care about doing things in elegant ways.
-
Lee B over 14 yearsYou'll be glad to know that they've "upgraded" their site address to "uk.rs-online.com/web". They did leave the title saying "Welcome to rswww.com" though ;D
-
Rhys over 13 yearsIndeed, the internet was totally unexpected in the capacity it is today. en.wikipedia.org/wiki/History_of_the_Internet
-
Pacerier almost 12 years@LeeB. Andrew is correct, this is the only technical reason why a new website creator will choose having
www
over not having it. -
Penguat about 11 yearsit's quite possible to have http over unusual ports...
-
Joseph Persie III about 9 yearsI am suprised nobody mentioned anything about XSRF and relevance to same origin subdomains.
-
jiggunjer over 8 yearsso servers like www.yourcompany.com and ftp.yourcompany.com historically had different IP addresses?
-
Django Reinhardt about 7 yearsThis is worded weirdly. There's STILL and Internet today, and it's still separate to the www :)
-
Atmocreations about 7 years@mk12. Despite the fact that http is used mostly for serving html pages (and associated assets), this doesn't necessarily need to be always the case: you can also serve xml, json or any other format understood by the http client (which is not always a browser). It really depends on the content-type.
-
Attie about 5 years@mk12 HTTP is "HyperText Transfer Protocol", and has no particular ties with HTML... You often download images, CSS and JavaScript over HTTP; APIs / services often use JSON / XML to pass data from machine to machine; etc...
-
Attie about 5 yearsCookies are a poor argument here... If you verbally say "superuser.com" to many people, they will still type
www.superuser.com
. This is why it's still important. How the site then handles adding or removing the prefix is up to the site. e.g: SU gives an HTTP 301. -
lmat - Reinstate Monica over 4 yearsExcellent answer, thank you. It is superfluous to have smtp.example.com, www.example.com, ftp.example.com, etc. because all the protocols operate on different ports, right?
-
Mostafa Lavaei over 2 yearsYou are right, historicaly www. Add
-
Mostafa Lavaei over 2 yearsYou are right. Historically www added like other sub-domains (FTP, SMTP, etc.). But technically, we can have all of them on root domain on different ports(80, 21, 25)