Last month, Google, Ask.com, Microsoft Live Search and Yahoo! launched a new tag format that allows you to specify your preferred version of a URL. This new meta tag tells these search engines which URL they should use as the canonical URL for the content, regardless of what session id, link parameter or other variable has been appended to the end of the URL. This is hugely beneficial to Mambo (and other dynamic CMS) users because it enables us to avoid duplicate content penalties.
One of the biggest culprits for causing duplicate content in Mambo is the frontpage component. Depending on the server settings, most sites can be accessed through:
- http://example.com
- http://example.com/
- http://example.com/index.html or http://example.com/index.php
- and sometimes also with both www and without it!
Mambo frontpages can be accessed through most of those as well, but also have additional URL's to contend with:
- http://example.com/mos/Frontpage/Itemid,1/ (with built-in SEF URL's enabled)
- http://example.com/index.php?option=com_frontpage&Itemid=1 (without SEF URL's enabled)
So, you can see that there is a lot of potential for duplicate content. The new search engine tag takes care of this. By setting the new tag in the head section of your template's index.php you can specify which URL you want to be used as the canonical URL - the authoritative URL for your frontpage.
To do this, simply add the following code above the closing </head> tag in your template's index.php file:
<?php if ($option == "com_frontpage") {
echo '<link rel="canonical" href="'.$mosConfig_live_site.'/"/>'."\n";
} ?>
The canonical URL is important for two reasons - firstly, to avoid duplicate content problems, and secondly, to avoid dilution of your page rank. If the frontpage can be accessed through many different URL's then other sites can link to it in many different ways. This spreads the page rank across the URL's as search engines treat each one as a different page, even though the content is the same. The new tag will consolidate all link popularity back to the URL you set as being the URL for the original content. It will also ensure that this URL is the one that is seen in search results.
Read More about canonical URL's and duplicate content in these articles:
- Using Canonical URL's
- Common Causes of Duplicate Content
- How to Avoid Duplicate Content Issues With Mambo
- Search Engine Optimisation Within Mambo
This new canonical tag is the single-most important change to search engine optimisation in a very long time.
Do you have other SEO tips for Mambo?
If you enjoyed this post, make sure you subscribe to my RSS feed!














{ 3 comments… read them below or jump to the comment form to add your thoughts }
Thank you very much for this post Elpie..this is grate..i was looking all over the internet for this piece of code...u made my day...cheers from romania
@Kaponne: I'm glad you found it useful Kaponne
Thanks a bundle from Ottawa, Canada, this is a great help!
Leave a Comment