Should You Use the WWW Subdomain? Why is it Even a Thing? Plus Some Advice
Since the web first became the web, web sites have used a www in front of their domain name.
But Why?
Is WWW a Subdomain?
Any character combination to the left of a period (.) in a domain name is a subdomain. So WWW is a subdomain.However, the WWW has some history that goes back to the web's early days. Back then it was more of a hint to the protocol and content.
Does your website need to use the www subdomain prefix?
What is the history behind using a www domain prefix?
The reason why business owners, IT admins and developers ask these questions is because many need to understand how domain names work. We use them everyday as a tool to access content and brand online content. They are more than just an easy way to find a webpage, they mean something to the computers and networks used to serve and display the content.
What is a Subdomain?
A subdomain is any child domain of a parent domain. All 'branded' domain names are child domains of top level domains. These are the phrases to the left of the parent domain.
For example in example.com, 'example' is the child or sub domain of .com. In www.example.com 'www' is a subdomain of example.com.
Domain names are really a more human consumable Internet address. Every computer (desktop, laptop, phone, server, refrigerator, etc) has an IP address. This is a collection of numbers segmented into 4 octets.
An octet is a number between 0 and 256. An IP address is a collection of 4 octets, each separated by a period.
Domains are more human readable as they incorporate letters, numbers and other characters. We can combine these characters into readable words, phrases and brand names. There are only a finite set of phone numbers we can remember, but words, far more.
Domain names include at least one top level domain (TLD). Common ones used today are .com, .net, .org and many country codes like .uk and .ca.
When you are buying a domain name (really leasing use), you are purchasing a subdomain of a top level domain. It can also be called a second level domain. You might also see the term child domain.
Once you own the rights to a domain you can provision as many subdomains as you like.
For example I often provision subdomains off Love2dev.com for demo applications and tools.
So, www is a subdomain of your domain, which itself is a subdomain. The www can also be called a third level domain, since it is one level below your second level domain.
History of WWW
Before the Internet became the World Wide Web there were many protocols used to server variety of things like telnet, email, gopher, FTP, etc. Oh the times we had way back in the early 90s and late 80s!
I miss Archie and Gopher.
Even though each service uses different port numbers and you also use a protocol prefix in the URL, server domains were often identified by the service abbreviation, like gopher.
This made it easier for system admins to configure individual servers to handle the different service request.
For example, 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 it was called the world wide web and abbreviated as 'www'. So system admins naturally created servers to respond for this new service type.
At the time it was not common to serve the content from the organization's domain. But that quickly changed as the web caught fire.
Serving the web became more popular than just about every other service, at least in the public's eye. So we also started looking for web sites by just entering the organization's domain, without the www prefix.
The web became the default service for a domain.
But system administrators had already started using the www subdomain and needed to do something.
So we started configuring the default service to respond when the HTTP protocol and port 80 was used is the web site. We also configured the www subdomain to be a CNAME alias to the primary domain.
Now both www.example.com and example.com return the same content.
But we now have an issue, two different addresses. We need to fix that.
To do so companies redirect one using a 301 status code to the other. It became vogue to market the www subdomain to indicate you were on the web.
I think that has changed today as more brands just market their primary domain. Browser also have a built in Ctrl+Enter shortcut that will wrap a www and .com around just the brand's core domain name.
So if you enter 'love2dev' in your browser's address bar and press Ctrl+Enter it will automatically go to www.love2dev.com.
But you will be redirected to love2dev.com because I use my primary domain as the main destination.
Why?
No specific reason, just a personal preference.
As long as you use only a single domain and make it the final destination you are in good shape.
If you are not using a 301 redirect to either www.yourdomain.com or yourdomain.com (.com is just an example top level domain extension) then you should. If you don't you risk having duplicate content, which reduces your ability to rank well in search results.
And if you are wondering, Google and Bing do not care if you use your primary domain or the www subdomain. Just pick one.
Another common reason why sub-domains are used is to silo cookies. In this case it is not an issue since you should be using a single domain destination.
Finally, larger web sites can find value in segmenting content and application functionality by sub domains. The www subdomain can be used to indicate it is web, while 'hr', 'finance' or 'app' can be completely segmented.
It is up to you if you use the www subdomain address or just your domain to promote your website. It is a branding choice. Just make sure you are consistent when you promote your address across all marketing channels.