Skip to Content
0
Dec 27, 2022 at 09:46 AM

The default canonical URL is set to localhost instead of domain URL. How to resolve this?

487 Views Last edit Dec 27, 2022 at 09:51 AM 4 rev

Hi, Everyone.

With Spartacus 4.0 onwards, the canonical URL is configured to be default as below. However, the canonical URL for PDP page has local IP address in quality and production environment. The other pages have the domain name as expected. Any help to resolve this

pageMeta: {
    canonicalUrl: {
      forceHttps: true,
      forceWww: false,
      removeQueryParams: true,
      forceTrailingSlash: true
    }
}

image.png

Setting it manually on PDP controller also didn't help. Any help to resolve this will be appreciated. Thanks!

this.pageMetaLinkService.setCanonicalLink(this.winRef.location.href);

Attachments

image.png (37.3 kB)