Many years ago, I made a decision for my website, alvintai.com, to omit the common ‘www’ subdomain when readers visit the site. This is done fairly easily within Wordpress as a simple 301 redirect. You can see this occurring if you curl my site:
When I was first starting my blog, I wondered why anyone would use the ‘www’ subdomain. It seemed like extra characters at a time when everyone was desperate to have shorter URLs, social media handles, usernames, etc. The most obvious reason was because it was simply easier to remember, just in case I ever needed to shout it out to someone who would be quickly out of earshot. Practical, right?
I most recently went to the Hewlett Packard website. I typed in www.hp.com and was immediately redirected to www8.hp.com. This made me question why someone within HP made a conscious decision to add the number 8 to a subdomain.
First, let’s go through a quick history why the ‘www’ is so common on the internet. It seems superfluous to have this subdomain attached to all websites. Back in the day, when companies started to own and maintain their own domains, they would create a subdomain for a specific department or type of traffic that their website would receive. It was common to separate groups like smtp.example.com to handle email traffic or ftp.example.com as a way to transfer files. The main frontpage of a company’s website became known as ‘www’: short for the World Wide Web. In fact, if you go to store.hp.com, there is no ‘www’ that precedes it. HP made the decision to separate this side of the website from the ‘www’ side.
For HP, you can follow the redirects using the same command as before:
Which brings us to why ‘www8’ exists. To be honest, this type of subdomain was way more prevalent in previous decades but has since started to fade away. While I’m not entirely sure why HP uses this subdomain, in the past, using a number after ‘www’ often meant it was being handled by a certain numeric server. As an example, in this case, it could have meant that this request was being handled from the 8th server in a company’s server farm. Historically, this was an easy way to load balance across multiple servers so that each server could handle a different subdomain. I’m hesitant to think that HP is handling its load balancing in this manner, which makes it all the more confusing.
It’s because load balancing has changed quite a bit since the days of yore. Today, load balancing is often handled at a DNS layer that abstracts the necessity to use a different subdomain. You can use the same URL and send the request to different servers intelligently without a 301 redirection. This is why you we don’t see many numbers at the end of ‘www’ sites these days; load is balanced on the backend giving the user a seamless experience.
For the average consumer, it’s sometimes jarring to see multiple redirections occurring when selecting a link. The redirections happen so quickly that you don’t know what (or who) is tracking your movements or where you will eventually land. This is a great reason to check links in emails to see where they actually go — I’m always suspicious when it’s a URL-shortened link or some sort of click tracker.
To close the loop about the ‘www’ subdomain, in modern web development, it turns out that there is actually a good reason to include ‘www’ to your URL. For a web developer of a complex application, it’s to keep your cookies in check. A cookie that is tied to the domain, *.example.com may overlap with any cookie under your root domain. For the domain *.www.example.com, your cookie will only live within that URL path. This is an easy way to efficiently use and separate your cookies.
All this cookie talk is making me hungry, so we’ll keep this post short and hope that was as interesting for you as it was for me.