Joomla site not ranking quite as well as you would hope for? It maybe worth checking to make sure your homepage is not indexed twice as http://www.yourwebsite.co.uk/ and http://www.yourwebsite.co.uk/index.php.
While you are at it, you may as well make sure you have not got any extra subdomains, alternate domains (.co.uk & .com) or listings for the http://www.yourwebsite.co.uk and http://yourwebsite.co.uk (no www).
All of these possibilities can lead to a reduction in the value (and subsequent rankings) of your current site and worst case, a dreaded penalty pushing you further down the search engine result pages.
To do a check, quickly search for some obscure text from your homepage in double quotes. You will then see all the pages returned for this. If you see multiple versions of your homepage or different URLs that all point to your site then you have a problem.
Mod Rewrite - The Caped Crusader
Fear not, help is at hand in the form of the Apache URL rewriting module mod_rewrite. With a few simple rules we can ensure your site has only one primary domain name and subdomain and remove any duplicate indexing of your homepage. We will be issuing a HTTP 301 status code along with our redirections to inform any search engine (hello googlebot) or site visitor that this is a permanent redirection and to update their records.
This is not a black hat or underhanded trick, in essence, we are just helping the search engine do it's job and making sure that there is only one version of our pages in the search engines index. This also benefits us all link juice coming into our site is correctly funnelled into a single URL and we won't get any duplicate content problems.
Getting Started
I am going to assume your .htaccess file is in place and you know where to add your rules, if not then first read our guide to adding rewrite rules to the Joomla .htaccess file and then come back.
Redirect index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.yoursite.co.uk/ [R=301,L]
Redirect Base Domain to www.
RewriteCond %{HTTP_HOST} ^yoursite.co.uk [NC]
RewriteRule ^(.*)$ http://www.yoursite.co.uk/$1 [L,R=301]
Redirect an alternative mapped domain to primary URL
RewriteCond %{HTTP_HOST} ^yoursite.co.uk [NC]
RewriteRule ^(.*)$ http://www.yoursite.co.uk/$1 [L,R=301]
Thats all folks
That's about the strength of it. Put these fixes in place and over the coming weeks (or months depending how often your site gets updated) you should see only a single version of your site in the index and a possible boost in your rankings.
Happy days.
