
As far as simple website optimization tips go this is probably one of the more basic of those and should definitely be considered when working on any type of website. You may or may not be aware of it but it is possible to access your website using two distinct URLs. The first is by including the www and the second is leaving it out.
Cut the Clutter: The Case for Removing ‘www’
For example, this blog can be accessed either via http://news-and-reviews.co.uk or via http://news-and-reviews.co.uk – both of which point to the exact same place.
When it comes to search engines it is possible and quite likely that they will see those two different URLs as being different sites. This means that in the eyes of the search engines there are two copies of your site meaning two copies of all of your content. This may have an effect on the duplicate content rules which these search engines use and therefore could make a difference to your ranking.
Redefining URLs: Say Goodbye to the ‘www’
More specific to Google, having two separate URLs means that PageRank will be split between them. Google may also not identify that they are in fact the same site meaning it’s very likely that each of them will be assigned a separate PageRank value.
The solution is simple and only takes a minute or two to implement. Start by creating an empty file at the root of your website called .htaccess (it really starts with a dot) and copy/paste in the following code snippet. If this file already exists simply copy and paste this code into the very top of the file above anything else.
1
2
3
|
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.news-and-reviews.co.uk$ [NC] RewriteRule ^(.*)$ http://news-and-reviews.co.uk/$1 [R=301,L] |
Now before saving you need to replace every instance of webdevelopmentblog.net in the above snippet to whatever your sites domain name is.
And that’s all there is. Now, when you visit your site using the www version you will automatically be redirected to the other version without even noticing. From now on with this simple hypertext access rule in place search engines will see your site as being just one.
If however you would like to go the other way you could always add the www into your URLs.