Canonical Meta tag is introduced to solve duplicate contents in a website. Suppose if you have a Joomla website and you have turned on the mod_rewrite settings and URL rewriting settings in your Global configuration, you will have your URL something like http://yoursite/some-page.html. Well that's it, NO...
You can still access this http://yoursite/some-page.html as http://yoursite/some-page. Well try that out. That's bad for SEO. What shall you do? Put redirect? No, that's not the right solution. Here Canonical URL will come to our rescue.
Joomla! 3 has settings for this and a few more free plugins to do this without hacking any codes. But what about Joomla! 2.5 and 1.5? A large number of websites run on these versions. Try searching for a free plugin to handle this and you will will come up with nothing or paid plugins( I also did the same thing once, lol).. You would not want to throw away a few $$ for this simple thing..
Well here is the solution, Download the attached zip file, extract it and upload it to the includes folder of your Joomla installation.
Then, head to your template index.php file or the head section of your template file(it will differ from template to template) and put the following lines of code snippet.
<?php include_once (JPATH_ROOT.DS.'includes'.DS.'canonical_tag.php');?>
That's it. Try visiting your http://yoursite/some-page.html and http://yoursite/some-page. Now, http://yoursite/some-page will have the canonical tag as
<link rel="canonical" href="http://yoursite/some-page.html">
Well, it tells Google or other search engine that both http://yoursite/some-page and http://yoursite/some-page.html are same .
How easy is that? Have any suggestions, don't hesitate to write it on the comments. We will appreciate that