Get Rid Of The ‘WWW’ Prefix – It’s Long Overdue

Mattias Geniar, Saturday, November 29, 2008 - last modified: Friday, November 21, 2008

To understand why the "WWW" prefix or subdomain is outdated, we should first look at the original definition of WWW.

World Wide Web
n. Abbr. WWW 
1) The complete set of documents residing on all Internet servers that use the HTTP protocol, accessible to users via a simple point-and-click system. 
2) n : a collection of internet sites that offer text and graphics and sound and animation resources through the hypertext transfer protocol.

The important part here is the HTTP Protocol. Whenever a link is made, such as http://<domain>, the software will know that a connection to a webserver is made, on port 80. That's what the http-protocol stands for.

The definition above implies that the "World Wide Web" uses the http protocol to send its data. Why then, do we still need to add the "WWW" subdomain? It's a waste of time to type it. Wouldn't it be easier to just type in the domain name, without the "WWW"?

While most webservers will accept traffic on the domain-name, without the WWW prefix, they usually redirect to the WWW-part of the website. Typing http://<domain> will often land you on http://www.<domain>. This should be the other way around.

Using the following .htaccess rule, you can safely redirect all traffic from http://www.<domain> to the http://<domain> version of your website.

Options +FollowSymlinks
RewriteEngine on
# Remove the WWW subdomain, and redirect to the domain itself
RewriteCond %{http_host} ^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,NC]

For more information on what Redirect-Code to use ([R=301]) I kindly refer you to the following page: Using Proper Header Redirects In PHP. There you'll find a good explanation on the difference in 301 and 302 redirects, and their effect on search engines.



Hi! My name is Mattias Geniar. I'm a Support Manager at Nucleus Hosting in Belgium, a general web geek & public speaker. Currently working on DNS Spy & Oh Dear!. Follow me on Twitter as @mattiasgeniar.

Share this post

Did you like this post? Will you help me share it on social media? Thanks!

Comments

Binny V A Saturday, November 29, 2008 at 20:55 - Reply

Actually, there are sites dedicated to this issue – like no-www.org


Leave a Reply

Your email address will not be published. Required fields are marked *