Issue ith canonical URLs

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
1 year 2 months ago #355856

Hi,

Then I'm not sure what the change should be. It would require some debugging of the Language Filter plugin.

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
1 year 2 months ago #355894

Hi Nicolas,

There's something that is confusing to me.
The canonical URLs work fine for one collection and not for the others. I can't understand why it's not consistent.
For the moment, as a temporary solution I disabled the "alternate" feature in the language filter plugin to have the canonical URLs displayed in the source code.

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
1 year 2 months ago #355909

Me again.

I have another site in 2 languages and on this one no problem, canonical URLs work and alternate URL too. So it should be something within the site which prevents things to work as expected

Sandra

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #356073

Hi,

I just noticed another issue with canonical URLs.

Even with Add Alternate Meta Tags on NO, the canonical URLs are not correct.
In the default language (US), it's ok, but not in French, the canonical URL remains the same as you can see for example on this page:
rolex.jewelrygoldfinger.com/fr/collection/yacht-master

The canonical URL should contain "fr" but it doesn"t. In fact it displays the canonical URL set up on the main screen and not the one set up in the French screen,

I'm really not sure it's an issue with the plugin.

I really need to be able to solve this issue but I have no clue how.

Thanks in advance for your help.

Sandra

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
1 year 1 month ago #356086

Hi,

Indeed, I can see the translation of the canonical URL is ignored. I've made a patch which should fix the problem.
Download again the install package of the 5.0.0 and install it on your website and you'll get the patch.

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #356088

Thanks a lot Nicolas. It works, 'fr' is now in the canonical URL.

I also noticed something (no clue if it can be of any help):
- Add Alternate Meta Tags on YES
- Remove URL Language Code on NO

For the default language (US), it's all good, canonical + alternate
In the second language (so here French), canonical is missing

Sandra

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
1 year 1 month ago #356093

Hi,

Isn't that the same problem we were talking about since the beginning of this thread ?

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #356133

Hi Nicolas,

Yes, it's part of the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
1 year 1 month ago #356138

Hi,

Well, if you can provide a backend and a FTP access, I can have a deeper look into it and maybe try to understand what can be done to fix the problem. If we provide a correct patch to the Joomla project, they'll be more reactive and integrate it in Joomla.

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #356146

With pleasure!

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
1 year 1 month ago #356157

Hi,

I think I found the solution.
Adding the line:

if($i !== $this->current_lang)
before the line:
$doc->addHeadLink($server . $language->link, 'alternate', 'rel', ['hreflang' => $i]);
in the file /plugins/system/languagefilter/src/Extension/LanguageFilter.php seems to do the job.

The following user(s) said Thank You: Sandra74

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #356181

Hi Nicolas,

You rock!
It works like a charm.

Thank you so much!

Sandra

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum