Yoast-SEO-for-Magento2 icon indicating copy to clipboard operation
Yoast-SEO-for-Magento2 copied to clipboard

[Feature Request] URL Suffix setting in Canonical Tag

Open kartguru opened this issue 5 years ago • 1 comments

Just noticed a few duplicate content issues because I have set the URL Suffix to not have a trailing slash and I believe Yoast SEO is adding a trailing slash and confusing Google.

A setting to define the Product URL Suffix and Category URL Suffix or using the Magento Admin option would be helpful.

Cheers

kartguru avatar Mar 15 '19 14:03 kartguru

As a temporary fix to this i removed:

public function getCanonicalUrl()
{
    $canonical = $this->getUrl('', [
        '_current' => true,
        '_use_rewrite' => true
    ]);
    if ($canonical
        && substr($canonical, -5) !== '.html'
        && substr($canonical, -1) !== '/') {
        $canonical .= '/';
    }

    return $canonical;
}

from /vendor/maxserv/magento-module-yoastseo/Block/YoastSeo.php

and continued to use Magento 2's built in canonical settings.

jamieparkes avatar Apr 23 '19 13:04 jamieparkes