October 28th, 2006
Most sites are accessible through either http://website.com as well as http://www.website.com. If anyone gave you a URL without the www would you assume that the same domain with a www would take you do a different site? Of course not. However, search engines are not always that smart. They may see http://fromthefrontend.co.uk and http://www.fromthefrontend.co.uk as two different sites.
Why is this a problem? Well it could have a negative effect on your search engine ranking. The “two sites” maybe viewed as a duplicate entry or you may have in cases promoted a www version and in others a non-www version without noticing and thus your efforts are diluted.
The solution?
Redirect traffic from your non-www to your www url (or visa versa). There are many ways to redirect a page - meta refresh, an info page advising to go to the correct url etc. But in this case your best option is the 301 redirect.
There are 2 main reasons
1) It is search engine friendly and will preserve your exisiting ranking
2) Most webhosts do not enable you to direct traffic for www and non-www to different destinations so you couldn’t put an info page or metta refresh in place to redirect the traffic
3) Using the wrong method can get you BANNED from google as Business.com discovered. Check out the full story on webpro
Fortunately the 301 redirect is easy enough to implement. You will need to be able to use .htaccess files (i.e using a Linux server running Apache and the Mod-Rewrite moduled enabled).
Create a .htaccess file containing the following:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
Put this in the Root of the site you wish to apply this to. Remember to change “yoursite.com” for your real domain.
WARNING: if your site already contains a .htaccess file then add this code to the bottom of that file (new paragraph).
I’ve used this technique on this blog. Try going to http://fromthefrontend.co.uk and see what actually appears in the address bar.
When you have set this up on your own domain check it working and is search engine friendly on the Search Engine Friendly Redirect Checker
If you found this tutorial useful and have implemented it please post your URL here so we can check it out. Any feedback on difficulties you may have had would also be useful.
If you want to see what else you can do with 301 redirects check out the webconfs seo toolset
Please note: I have not tried all of the 301 methods listed on webconfs and the .htaccess option they have listed did not work for me (needed slight amendment) so please test for yourselves.
Filed under Newsflash, Tutorials |