ethercreative / seo

SEO utilities including a unique field type, sitemap & redirect manager
MIT License
267 stars 95 forks source link

Problem with canonical #469

Open giampo1991 opened 6 months ago

giampo1991 commented 6 months ago

Description

Since the last update there were problems with canonical headers. On multisites with languages ​​in the subdirectory the canons appear as "https://www.mywebsites.com/en/en/about-us". sometimes even the folder was repeated three times.

Steps to reproduce

1.Update craft to the latest versione 2.Update SEO to the latest version

Additional info

alexjcollins commented 6 months ago

@giampo1991 Thanks for sharing—we'll take a look.

cristiano-c1 commented 5 months ago

following, same problem here, on a multisite installation

  1. Craft CMS 4.8.3
  2. SEO version:4.2.2
  3. PHP_VERSION | 8.1.27
fvwanja commented 5 months ago

Same here 👋

Craft version: 4.8.1 SEO version: 4.2.2 PHP version: 8.2.0

HarroH commented 4 months ago

Same issue here.

Craft version: 4.8.11 SEO version: 4.2.2 PHP version: 8.3.6

Issue seems to come from the fix related to the pagination in the canonical link. The getFullPath function returns the language path included in the path and the UrlHelper::siteUrl already has the language path in it. So it gets a double language path on the return.

Rolled back to version 4.2.1 to fix it. Don't have enough knowledge of craft and the pagination fix (what it fixes) to come up with a solution for this. Hope someone does!

mazaalai commented 3 months ago

Is there a solution to this problem? I have the same problem with my site.

I think that this broke the canonical. "use pagination information on canonical (via @therealpecus)"

image

therealpecus commented 3 months ago

Hi all, sorry for this nasty bug I introduced while fixing the canonical in paginated pages.

I'll take a look and revise the code so that it keeps pagination info but avoids repeating the language prefix. In the meanwhile you can downgrade to 4.2.1 as suggested (edit your composer.json and specify the dependency as

"ether/seo": "4.2.1",

without the caret in front, then run composer update

mateostabio commented 1 month ago

This is a serious issue. All our SEO traction we built until now has been on a slow decline for the past 2 months since the introduction to this issue.

therealpecus commented 1 month ago

to everyone coming across this issue:

This is a free plugin, and we can't expect the maintainer to be always available. I am providing a couple of workarounds to allow everyone to adopt a fix in the meanwhile. Use either one depending on your familiarity with the process.

workarounds

If you downgrade via composer, the plugin version will be pinned in your composer.json and composer will not try to update it. When an update is release, use composer require ether/seo to unpin the plugin version, or update via Craft UI.