Helping the Search Engines
Tuesday, July 8th, 2008
(This is a search engine optimisation tip.)
How many home pages do you have?
You probably think you’ve got one, and you’ve probably got four.
I used to have four:
http://slightlyaskew.co.uk
http://slightlyaskew.co.uk/index.php
http://www.slightlyaskew.co.uk
http://www.slightlyaskew.co.uk/index.php
And whatever URL you used, the same page would appear.
So why does it matter?
Well, it’s to help those wonderful search engines that you want to send free traffic your way. Google will count them as four separate pages because you could have four different pages that appear for those URLs (the fact that you haven’t matters not).
And having four separate pages isn’t good for backlinks.
If you’ve got 100 good backlinks, yet they’re split 25/25/25/25 across the four URLs, then search engines aren’t going to give your home page the respect it deserves.
To optimise your site, you need to permanently redirect the four URLs to one.
I’ve chosen the www version without the index.php bit.
In order to do that, you need to add the following code to your .htaccess file that sits in the root directory of your website.
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^slightlyaskew\.co.uk [NC]
RewriteRule ^(.*)$ http://www.slightlyaskew.co.uk/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.slightlyaskew.co.uk/ [R=301,L]
Obviously, you need to change the slightlyaskew.co.uk bits (and the index.php bit if you’re using index.html site).
This is called a 301 redirect. Google prefers 301 redirects if you’re permanently redirecting the search engine spiders.
Don’t ask me to explain any the technical side to this because I don’t understand it. Try Matt Cutts: he works for Google and uses words like canonical. I’m just a yokel from Ipswich.
But, for this Ipswich yokel, the code works. And if it helps improve your website’s visibility, I reckon it’s five minutes of search engine optimisation worth doing.
Categories SEO