I use the Joomla! component sh404SEF on the Cybersalt site. It's great for giving my pages SEF (Search Engine Friendly) URLs. Unfortunately, sh404SEF does not include something very helpful to make the urls even more SEF friendly - canonical url specification. But it will with a little tweaking!
You see, Google does not like duplicate meta descriptions on a site and if you have enough of them you may get penalized because the presence of these duplicates gives the appearance that you are trying to trick search engines into weighting your site higher for traffic.
The problem with this for Joomla users is that some options in the URLs of our pages appear to be different pages to Google. For instance, currently google sees the following urls as two separate pages:
You and I can both see that they are the same page, but to Google they are two pages - and two pages with the same Meta Description at that. What is needed is is for each page on a Joomla site - even those with settings encoded within them - to have it's specific single URL stated for search engine spiders. To the search engine, this declaration of a page's canonical URL overrides the address it sees when visiting all links on our sites. In short each page needs coding like this in the header.
To achieve this with sh404SEF needs a little tweaking of it's code. Before I give you that tweak I use on the Cybersalt Site, I want to first of all give credit to Bruce Rick for intially helping me with accomplishing this on my site a number of versions ago. His article and reader's comments at http://www.brucerick.com/joomlas-sh404sef-and-canonical-links/ totally got me on to the solution. I've decided to paste the tweak that is working for my site here, as a way of tracking the changes for my own use since the comments on that page are getting pretty long.
So without further delay, here is the tweak I use to get sh404sef 126.96.36.1998 running on Joomla 1.7.3 to specify the canonical url for each of my site's pages:
- Back-up your site and database. This will enable you to not be mad at me if something unexpected happens along the way.
- Open the file components/com_sh404sef/shPageRewrite.php
- Go to line 413 (or there abouts) and locate and replace:
// all done
// CANONICAL LINK FIX
$buffer = shInsertCustomTagInBuffer( $buffer, '</head>', 'before', '<link rel="canonical" href="'.$shPageInfo->shCurrentPageURL.'" />', 'first');
//CANONICAL LINK FIX - END
// all done
That should do it!