diff --git a/src/ConsenHead.js b/src/ConsenHead.js index bbeb252..95d686b 100644 --- a/src/ConsenHead.js +++ b/src/ConsenHead.js @@ -6,7 +6,8 @@ const ConsenHead = ({ title, description }) => { const siteUrl = "https://metatroncubesolutions.com"; const cleanPath = router.asPath.split("?")[0]; - const canonicalUrl = `${siteUrl}${cleanPath === "/" ? "" : cleanPath}`; + // Ensure the URL always ends with a / because trailingSlash: true is set in next.config.js + const canonicalUrl = `${siteUrl}${cleanPath === "/" ? "/" : (cleanPath.endsWith("/") ? cleanPath : `${cleanPath}/`)}`; const defaultTitle = "Metatroncube: Leaders in Web & Mobile Dev, SEO, Digital Marketing"; const defaultDescription =