?
avatar jeffmoz
jeffmoz
27 Feb 2015

I have a problem after updating to Joomla 3.4
meta tag: rel "canonical" disappeared after updating completely.

only Joomla v. 3.4 installed, no external plugins

PHP 5.4.16
MySQLi 5.5.32
Apache/2.4.4

avatar jeffmoz jeffmoz - open - 27 Feb 2015
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 27 Feb 2015
Category Front End Router / SEF
avatar zero-24 zero-24 - change - 27 Feb 2015
Category Front End Router / SEF Front End
avatar orware
orware - comment - 27 Feb 2015

Hi Jeff,

Hmmm...taking a look at the source code, it looks like the canonical header tag is being added in by the System SEF Plugin in Joomla.

There have been some modifications to that file between Joomla 3.3.6 and Joomla 3.4 so those are likely the cause of the new behavior:
https://github.com/joomla/joomla-cms/commits/staging/plugins/system/sef/sef.php

I'm wondering if @Hackwar might have some quick suggestions?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6217.
avatar orware
orware - comment - 27 Feb 2015

At the moment this seems to be working correctly though from my perspective.

I ran through this example on my end on a basic install:
http://localhost/joomla340/
Results in a being added

If I'm on the canonical URL:
http://localhost/joomla336/index.php

Then no canonical element is added in.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6217.
avatar orware
orware - comment - 27 Feb 2015

It looks like I can't included HTML tags in these responses.

I ran through this example on my end on a basic install:
http://localhost/joomla340/
Results in a [link href="http://localhost/joomla336/index.php" rel="canonical" /] element being added to the page.

If I'm on the canonical URL:
http://localhost/joomla336/index.php

Then no canonical [link] element is added in.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6217.
avatar Hackwar
Hackwar - comment - 28 Feb 2015

This is expected behavior. The canonical tag, by the definition of Google, should only be present on pages that should actually be called with a different URL (= the canonical URL) and thus on the page with the canonical URL, the tag should not be present. This however is only a slight improvement over previous versions of Joomla. In previous versions of Joomla, the system simply always took the current URL as canonical URL and added it to the header, regardless if that actually was the canonical URL or not. The fix now does not show the canonical tag where the current URL is identical to what the router thinks is the canonical tag. Since the router however is still broken, this detection is not 100% correct. A fix for this will come in 3.5.

Tl;dr: The current behavior is expected.

avatar jeffmoz
jeffmoz - comment - 28 Feb 2015

thanks for clarification. I hope, the fix will follow with J3.5

avatar pieter-groeneweg
pieter-groeneweg - comment - 28 Feb 2015

Expected behaviour should be 100%.
In my below sample it shows it cannot be used as I now still may end up with duplicates... or worse:

http://domain.com/en/category/1-article.html
shows no canonical

same page accessed as:
http://domain.com/en/category/1
shows canonical:
http://domain.com/en/category.html?id=1
where canonical expected should be:
http://domain.com/en/category/1-article.html

http://domain.com/en/category.html?id=1
gives me a 404....

if that is the case and only be solved in 3.5, it better not be there on any page and leave canonicals to third party solutions till then?
This is gonna F/U the indexing in google
And I rather have a duplicate then a 404...

avatar Hackwar
Hackwar - comment - 28 Feb 2015

It's been like that since Joomla 2.5. This is not new in 3.4 or even in 3.x.

pieter-groeneweg notifications@github.com schrieb:

Expected behaviour should be 100%.
In my below sample it shows it cannot be used as I now still may end up with duplicates... or worse:

http://domain.com/en/category/1-article.html
shows no canonical

same page accessed as:
http://domain.com/en/category/1
shows canonical:
http://domain.com/en/category.html?id=1
where canonical expected should be:
http://domain.com/en/category/1-article.html

http://domain.com/en/category.html?id=1
gives me a 404....

if that is the case and only be solved in 3.5, it better not be there on any page and leave canonicals to third party solutions till then?
This is gonna F/U the indexing in google
And I rather have a duplicate then a 404...


Reply to this email directly or view it on GitHub:
#6217 (comment)

avatar pieter-groeneweg
pieter-groeneweg - comment - 28 Feb 2015

Really? In my 2.5 or 3.x sites there was never a canonical set but by my third party extensions...
So maybe the router wasn't a 100% but canonicals weren't set.

avatar Hackwar
Hackwar - comment - 28 Feb 2015

This feature was added in september 2012. c236189

pieter-groeneweg notifications@github.com schrieb:

Really? In my 2.5 or 3.x sites there was never a canonical set but by my third party extensions...
So maybe the router wasn't a 100% but canonicals weren't set.


Reply to this email directly or view it on GitHub:
#6217 (comment)

avatar pieter-groeneweg
pieter-groeneweg - comment - 28 Feb 2015

Odd it never showed before at least in my 2.5 sites it isn't there...
There is no lines on canonicals in the SEF plugin for 2.5
In the 3.x plugin code it also says "since 3.0"
I need to take a good look at the 3.x sites as this still makes it a good reason to get rid of it or make it work. If it is not going to be fixed until 3.5, it better be disabled.

I can imagine 2.5 sites with no canonicals set migrated to 3.x now with canonicals incorrectly set may suffer from 404's on canonical link...

avatar Hackwar Hackwar - change - 1 Mar 2015
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2015-03-01 10:18:55
Closed_By Hackwar
avatar joomla-cms-bot joomla-cms-bot - close - 1 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - close - 1 Mar 2015
avatar Hackwar
Hackwar - comment - 1 Mar 2015

As I wrote, this is not a bug, so I'm closing this one.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6217.
avatar joomla-cms-bot
joomla-cms-bot - comment - 1 Mar 2015

Set to "closed" on behalf of @Hackwar by The JTracker Application at issues.joomla.org/joomla-cms/6217

avatar pieter-groeneweg
pieter-groeneweg - comment - 5 Mar 2015

Explain to us why it isn't a bug.

Showing the wrong canonical, a url giving a 404, is certainly not desired behaviour.
If you expect it to be wrong, you may name it "expected behaviour" but till it is solved it only is doing damage. It is unwanted behaviour...

If it only can be solved in 3.5, it should not be in the SEF plugin till then.

avatar Hackwar
Hackwar - comment - 5 Mar 2015

The URL in the canonical tag is not giving a 404 and J2.5 sites wont have canonical-URLs that now point to a 404. The router will simply not create a URL that is really, truely canonical, but some more or less random URL that still does point to the content that is displayed on that page.

If you think that this feature should not be part of 3.x until the router is fixed, please open another issue and fight it out with the people there. I couldn't care less about canonical tags. I only care for the proper usage of this. And that is why I fixed one of around a dozen bugs in this feature in 3.4. I plan on fixing more of those issues in 3.5. Considering the position of the leadership towards backwards compatibility, your chances of removing this feature in future versions until it works correct are extremely slim. Considering how little people know about canonical URLs and the canonical tag, I doubt that you will get much backing in the community. If there was a real interest in that, people would have given more support to fix this already in 3.4. See here: https://github.com/joomla/joomla-cms/pulls?q=is%3Aopen+is%3Apr+author%3Ahackwar+routing

avatar hogash
hogash - comment - 20 Apr 2015

Hey guys, i aswell notice a bug here. For example in the System - SEF Plugin into the domain field, when i'm adding http://www.mywebsite.com (without the ending /) the canonical link tag does not appear into the source.

When i'm adding http://www.mywebsite.com/ (with the trailing /) the canonical link tag appears into the source BUT like this http://www.mywebsite.com// (doubled slash) .

Joomla 3.4.1 ( Search Engine Friendly URLs - Enabled; Use URL Rewriting - Enabled )

avatar OctoKitty
OctoKitty - comment - 22 May 2015

@Hackwar : "The canonical tag, by the definition of Google, should only be present on pages that should actually be called with a different URL (= the canonical URL) and thus on the page with the canonical URL, the tag should not be present."

I think this statement is false.

Google documentation says:
"Mark up the canonical page and any other variants with a rel="canonical" link element."

https://support.google.com/webmasters/answer/139066?hl=en#2

So, SEOs say that's an important issue.

avatar YaegerDesign
YaegerDesign - comment - 4 Feb 2016

This is still an issue! Take for instance this category listing page accessed by the menu item alias:
http://surfaceartinc.com/news.html
There is no canonical URL set, which should be the desired approach. However, if I access the same category listing page by using the category alias, there is still no canonical URL given, even though the pages are identical:
http://surfaceartinc.com/blog.html
If I strip the ".html" from either URL, a canonical URL is added with the ".html" extension added:
http://surfaceartinc.com/blog
http://surfaceartinc.com/news
However, there is no link between the two aliases blog & news, which should be there!

avatar brianteeman
brianteeman - comment - 4 Feb 2016

Commenting on a closed issue will guarantee no one sees it

avatar infograf768
infograf768 - comment - 5 Feb 2016

The "core" canonical feature has been solved in 3.5.0/staging
#8568

Add a Comment

Login with GitHub to post a comment