This tip only applies if you own your own domain name, and can access your server.

If you own your own domain like http://www.blog-op.com, you may have noticed that you can type in http://blog-op.com and end up at the same place. This is because the addresses are essentially the same, and the www is actually superfluous. So what?

Well, if someone links to your www address, and then someone else links to your non-www address, then Google (and others) don’t treat them as 2 links to the same site, but rather links to two completely different sites. This obviously has implications for calculating page rank, as both versions of your address may have their own pagerank, neither of which are as high as they should be.

This was brought home to me when I used the useful Smart PageRank tool (Thanks Tricia) and it showed that Blog-Op had a page rank of 2 for the www address, and 4 for the non-www address. Now, combining the two won’t mean I get a pagerank of 6, but you need a reasonable number of links to get a PR of 2, and these really should be going towards making my non-www address get a PR of 5.

How to fix it? Easy; log on to your server with an FTP program and find the .htaccess file in the root directory. Download it, open it with WordPad or NotePad, and then insert the following code into the file after whatever else is in there, but before the ‘# END WordPress’ tag at the end.

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

Obviously substitute the ‘YOURDOMAIN’ for your address, and be careful not to disturb the backslashes which are correct. Save the changes and upload it back to the server. This will now redirect everyone and every Google bot who looks for www.YOURDOMAIN.com to the non-www address without them even noticing, and ensure that ALL of your inbound links count towards your pagerank score. It’s easy and takes less than a minute to do, but as ever make a copy of your .htaccess file before making any changes.

Thanks for the code to, and more information on the matter at: no-www.org.