Yoast-SEO-for-Magento2
Yoast-SEO-for-Magento2 copied to clipboard
[Feature Request] URL Suffix setting in Canonical Tag
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
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.