Skip to content

Commit

Permalink
Merge pull request #45 from EmicoEcommerce/fix/canonical-url
Browse files Browse the repository at this point in the history
Fix canonicalURL does not have a trailing slash
  • Loading branch information
stijnbernards authored Jun 14, 2022
2 parents 15e0dcb + d013f10 commit 3af940f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Observer/SeoObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function getCanonicalUrl(LandingPageInterface $landingPage)
return $landingPage->getCanonicalUrl();
}

return $this->storeManager->getStore()->getUrl($landingPage->getUrlPath());
return $this->storeManager->getStore()->getUrl('', ['_direct' => $landingPage->getUrlPath()]);
}

/**
Expand All @@ -134,4 +134,4 @@ protected function clearCurrentCanonical(LandingPageInterface $landingPage)
$category = $this->categoryRepository->get($landingPage->getCategoryId());
$this->pageConfig->getAssetCollection()->remove($category->getUrl());
}
}
}

0 comments on commit 3af940f

Please sign in to comment.