Jeff VIP
Total posts: 745
31 Март 2016 01:26

Hi,

I have noticed that Cobalt produces multiple canonical urls:

<link href="/ http://mysite/directory " rel="canonical" />
<link href="/directory" rel="canonical" />

I can only guess that the first link is generated by Cobalt, since all non Cobalt pages have a single canonical link similar to the second one. Another issue is the incorrect http:// protocol, which in my case should be: https://

Best solution:

<link href="/ https://mysite.com/directory " rel="canonical" />

Best regards, Jeff

Последние изменения: 01 Июнь 2016


jimie VIP
Total posts: 531
31 Март 2016 04:29

Hello Jeff,

This may answer your question:

https://github.com/joomla/joomla-cms/pull/9565/files

As about the http:// you can open this file:

views/records/view.html.php

And change:

$this->document->addHeadLink(JRoute::_($this->item->url, TRUE, -1), 'canonical');

to this:

$this->document->addHeadLink(JRoute::_($this->item->url), 'canonical');

Hope it can help you.

Rgds


Jeff VIP
Total posts: 745
31 Март 2016 05:54

jimie Hello Jeff,

This may answer your question:

https://github.com/joomla/joomla-cms/pull/9565/files

Hey jimie, Thanks. After some further investigation I saw that my system SEF plugin had no site domain set. After setting the site domain, the canonical link shows the full absolute link :-)

Does this mean I don't have to modify views/records/view.html.php anymore?

The issue that Cobalt adds an extra canonical link in the header remains though....


jimie VIP
Total posts: 531
31 Март 2016 06:04

Hello,

The problem is actually caused by joomla SEF plugin, that why I posted this link where you can see what Joomla! devs did to sort the problem: Click here to link...

You can view the working file here:

Click here to link...

Rgds


Jeff VIP
Total posts: 745
31 Март 2016 06:46

Ah! After replacing sef.php and sef.xml with the Github versions the issue seems to be resolved.

Interestingly, modifying views/records/view.html.php has no effect. The good news is that it is a Joomla bug and not caused by Cobalt. we'll just have to wait for the next update...

Thanks, jimie.

Работает на Cobalt