Feed on
Posts
Comments

www subdomain

You’ve probably noticed that some websites start with ‘www’ and others do not. Sometimes you’ll see http://www.example.com and other times you’ll just see http://example.com. What’s the deal with this and why does it matter? The World Wide Web is a collection of pages, hypertext documents that are hyperlinked together creating a body of information. This runs on the Internet, which is a collection of computers servers and cabling. The default protocol for the web is HTTP and thus browsers will prepend http:// to the URL entered and then attempt to connect on port 80. Mail servers don’t require you to send mail to recipient@mail.example.com, likewise why would a server require you to use the ‘www’ subdomain? The convention of adding the ‘www’ subdomain to your website is redundant, and often without purpose, consuming extra time for no particular reason.

For many people this will have little bearing on their sites and you can choose what you like best, but from an SEO standpoint it can have an effect. You probably don’t want Google having a separate index and pagerank for both www.yoursite.com and yoursite.com. You should rather have Google only index you once so that all you visitors are focused on the same url.

I have http://www.johncacka.com redirect silently to http://johncacka.com, this allows visitors to type in the URL either with or without the ‘www’. After the url is typed in however, it will always change to http://johncacka.com. On my hosting account the interface allows you to easily set this redirect without editing the .htaccess file. If this is not the case with your host the following will work if you are using apache with the Mod-Rewrite module enabled. Be sure to change ‘yoursite’ to your domain.

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

This will change your site to always remove the ‘www’ but still take visitors to your site, without merely turning it off and dropping visitors. The other thing you may wish to do, is to set the preferred domain with Google, which you can do easily with their webmaster tools, http://google.com/webmasters. This will tell Google which way to list your site in their index, and will help keep all the links out there contributing to the pagerank for one copy of your site rather than two.

Bookmarks| Blogmarks | del.icio.us | Digg it | Furl | reddit | Wink | Yahoo MyWeb

Trackback URI | Comments RSS

Leave a Reply