Home Joomla Canonical URL Module
Joomla: Canonical URL Module
Written by Andreas Berger   
Friday, 13 February 2009 22:55

 

The bretteleben.de "Canonical URL" Module for Joomla 1.5 allows to set selective the - supported by Google from this month on - "Canonical URLs" in the HEAD of single Pages. This helps to prevent being punished for delivering DuplicateContent and to concentrate PageRank to the main URL, if a page can be reached from different URLs.

bretteleben.de "Canonical URL" Module for Joomla 1.5

The bretteleben.de Canonical URL Module works with Joomla 1.5.

The module offers 10 pairs of parameters to modify the real URL and use the result to set the TAGs <link rel="canonical" href="/desired link">. Starting with version 1.1 it is possible to run multiple instances of the module against a page. They are executed in the order they are set in the backend.

New in Version 1.1:

- possibility to run multiple instances against one page

Features:

- replace single parts of the path
- remove unwanted GET-parameters
- set a fixed URL
- run multiple instances against one page

Installation and Usage

1.) Upload and install the Package.
2.) Activate the module for all or selected Menu-Items.
3.) Parameters:
There are 10 pairs of parameters available.
Each pair consists of the text to search (1th part) and the text to replace with (2nd part).

Sample1: You use Joomfish but don't have translated all of your pages. To prevent getting punished for delivering DuplicateContent, you set the canonical URL of - not translated - pages to URL of the the main language.

Rule01: Find part of URL: lang-de (still delivers english content)
Rule01: Set part of URL: lang-en (this is your main language, we use it as canonical url)

Using this rule for pages - still delivered in english but reached in the section /lang-de/ - sets the canonical URL for this pages to /lang-de/ and prevents DuplicateContent.


Sample2: You use (as I do) yvComment, but don't want to get the pages with the request-parameters (start=10, 20, and so on) to get indexed to concentrate PageRank to the "main"-pages.

Rule02: Find part of URL: start=
Rule02: Set part of URL:

The text in the first part of this rule ends with an equal sign. This tells the module, that we want to modify a request-parameter. The module now replaces not only "start=" but includes the values (0,10,20,30,...) too. The whole parameter is replaced with the text given in the second part of the rule, in this sample: nothing, i.e. the whole parameter is removed from the URL.
Notice: You must not include ? or & (resp. & amp;). These are handled by the module automatically.


Sample3: You want to set for a special page a fixed canonical URL to be used for indexing the page, whatever parameters the page is called with.

Rule03: Find part of URL:
Rule03: Set part of URL: /my-desired-canonical-url.html

In this case the first part of the rule stays empty, this way telling the module that the complete (relative) URL is to replace.


The module works down the rules one by one and inserts the resulting URL as rel="canonical" URL into the head of your page(s).

The domain-part of the URL is NOT modified. This should be done by using redirects.

Limitations:

Bug-reports, Feature-Requests, Hints are highly welcome.

Please handle with care, because wrong settings (unreachable) may cause pages from dissapear from the Google-Index completely! Check every set rule within the source of the concerned page(s)!!!
The module is NO replacement for Joomlas SEF-plugin or an external SEF-extensions! It is only a supplementation!

A step by step tutorial will follow.

Demo

The module is used to set a canonical URL for the menu item Very Simple Image Gallery and removes the yvComment-parametrs, even when browsing the comments.

Compatibility

The module is tested successful with Joomla 1.5.6, 1.5.7 and 1.5.8. Anyway, using it aside with one or another existing plugin/modul/component may bring to light problems i haven't foreseen.
Again I suggest a test run before using it on a live site and stand by for your questions and suggestions.

License

The module is licensed under the GNU Public License (www.gnu.org/copyleft/gpl.html).

update Version: 1.1.0

Version 1.1.0 - 2009-03-29

- check if a canonical URL is already set by another instance and work with it

Version 1.0.0 - 2009-02-13

Support

If you have questions or suggestions, please use the comment-function. Records about the behavior of this extension (positive or negative) are most welcome.

If you use this extensions, you have the possibility to post a rating and a review at joomlaos.de or extensions.joomla.org. Furthermore I appreciate everyone, supporting me with a link back to www.bretteleben.de on his/her website. The extension itself does not produce any hidden links, eastereggs or whatever.

Download

The ZIP-archives contain the module, by downloading it you agree to the terms of the GNU Public License. The ZIP-Archive can be used for both, upgrade and fresh installation.

Downloads:
FileLast Modified
Download this file (mod_canonical_1.1.0.zip) mod_canonical_1.1.0.zip2009-03-29
Last Updated on Wednesday, 13 January 2010 09:10
 
Comments (3)
Canonical URL Module
3 Monday, 23 April 2012 11:50
Jason

Hi

Have loaded up the module for www.careersinafrica.com as Joomfish has been loaded but not translated properly. Have tried to put the parameters lang-fr & lang-en as stated in your example but can't then find the tag in the relevant pages code.

Any help would be appreciated.

Thanks
Jason

@Jason
Monday, 23 April 2012 21:13
A. Berger

Hi Jason!

If I open the page you linked to, the canonical tag is between the favicon and the first stylesheet (link href="http://www.careersinafrica.com/en" rel="canonical").

Best regards
Andreas

Is this EZ-autos compatibe?
2 Wednesday, 11 April 2012 21:44
jeyjoo

Hi,

My site is this Italian furniture site, ArredoScout.
The site uses Ez-autos which results in a large number of duplicate pages, and would benefit from a canonical link. Has anyone tried this module with ez-autos?

Many thanks
Jeyjoo

Canonical cross-domain
1 Wednesday, 27 April 2011 09:42
timo

Hallo,

Ich habe das Problem dass meine Seite über zwei Domains abrufbar ist und ich möchte eine als Standard definieren. Soweit ich weiß funktioniert das rel = canonical auch cross Domains. Lässt sich dass mit Deinem Modul abbilden?


Danke!!

@timo
Wednesday, 27 April 2011 20:52
A. Berger

Hallo timo!

Dafür ist dieses Modul eigentlich nicht gedacht. Ich würde das eher über einen echten 301-redirect am DNS einer der Domains oder zur Not noch über die .htaccess Datei lösen. Alles Andere ist meiner Ansicht nach Stückwerk und auf Dauer nicht zielführend.

Gruß
Andreas

English
Panoramic Image Viewer
Follow me on Facebook
Follow me on Google+

bretteleben.de

Add to circles

Who's Online
We have 56 guests online