www. is NOT deprecated

Update: This was an opinion piece written back in 2005 to provoke discussion from the other side of the argument. Read the comments for the most up-to-date information and feel free to add your opinion below.

Having no www. is wrong. Why?

Why can’t we just use both?

You can use both as long as you redirect your traffic from one to the other (eg: example.com redirects to www.example.com). Why?

Well that is simple. It affects the way your website is optimised.

As search engines see a subdomain as a separate site if you run your website on www.example.com and example.com it effectivly means you have two copies of the same website. This means you are taking the focus from one website to two, if you wish to build up traffic it is best to make things as simple as possible for your visitors. Let them know that there is only one URL for your website, as this will considerably help you when people add backlinks to their website, or bookmark your website. It will also help with how search engines index and rank your website.

Its quite important that when you start developing a website you decide whether your going to direct your visitors to www.example.com or example.com as you will need to focus on one.

Redirection

These redirection methods are used to redirect your domain (eg: example.com) or wildcard subdomain (ie: *.example.com) to www.example.com.

mod_rewrite method:

Add this to your .htaccess file (providing mod_rewrite modual is installed in your apache). (See Apache mod_rewrite)

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

php method:

Place this at the top of your index.php in your php code.

if ($_SERVER["HTTP_HOST"] != "www.example.com") { header("Location: http://www.example.com/"); die; }

Hostnames, protocols and examples

As you can see in all these examples, as long as example.com is pointing to the same IP as the host, you could use the domain name instead of one of the hosts above.

The Spamcalc website explains the original concept and usage of Subdomains/Hostnames. It explains that the original purpose of subdomains is to show a hierarchical (eg: computername.subdomain.domain.topleveldomain).

This makes sense when looking at the above protocols and services. As originally, and still today depending on demands, each service is run on a seperate machine (or seperate machines) as an attempt to dispurse heavy usage loads. However unless you run a large international network and have many thousands of users chances are you do not need this kind of structure. It is also apparent that as computers are getting faster and faster they are more than capable of running all these services on one machine.

As your website/services expand, it makes sense that you might need to shift your services onto different machines, to achieve this each machine will need a different IP address. Therefore they will require a different host, as both servers cannot use the domain name, they will need to be assigned the specific hostname, which will ultimately depend on what service they will be running.

Although it sounds complicated, its actually very simple, which is why it makes sense to use the prefix.

Arguments for the other way

Apart from the points made at no-www.org the other reasons why www. has deprecated…

Resources

no-www.htm