Shop pages and canonical URLs

Current version: 10.1

To improve how your web shop ranks in search engine results, you can assign canonical URLs to the pages in your storefront.

A wildcard page maps all URL paths to a common child of that item. You use wildcard items to reuse and share data. If the name of an item is an asterisk (*), then that item is a wildcard. If the directory part of the URL path maps to an item, but that item does not have a child with a name matching the file name part of the URL path, and a wildcard item exists at that location, Sitecore sets the context item to that wildcard item.

The Storefront sample site has the following wildcard pages:

  • The canonical Category page (Category/*)

  • The canonical Product detail page (Product/*)

  • The Category page for site navigation (Shop/*)

  • The Product detail page for site navigation (Shop/*/*)

    Category, Product and Shop wildcard pages in the SXA Storefront.

When a customer browses your storefront, they might see different URLs for the same page, depending how they navigate to the page. You must assign a canonical URL to each page. You can choose which terms to use for product, category, and shop in the URLs.

Shop page URLs and canonical URLs

The Shop/* and Shop/*/* pages display the category and product pages within the navigation structure of your website. When a customer navigates on your website, they see shop as part of the URL path, for example: https://<server>/shop/Audio%3dhabitat_master-audio.

To improve the search engine ranking of your website, it is important you assign canonical URLs to shop pages.

Note

If you create your storefront site using the Storefront site template, then a canonical URL is automatically included in the metadata for every storefront page.

If you create your own page designs, you can insert the Commerce Metadata meta rendering from the SXA toolbox in your page designs to assign canonical URLs to every page.

The following tables show the navigation URL and the canonical URL for two pages in the SXA Storefront:

Audio category page

URL after navigating from the home page

https://<server>/shop/Audio%3dhabitat_master-audio

Canonical URL

https://<server>/category/Habitat_Master-Audio

Bookshelf speakers product detail page

URL after navigating from the home page

https://<server>/shop/Audio%3dhabitat_master-audio/514Punch2-WayBookshelfSpeakers%3d6042080

Canonical URL

https://<server>/product/6042080

Note

If you want canonical URLs to remain the same regardless of where the catalogs are configured, use the wildcard approach.

Renaming the Product, Category, or Shop page

As demonstrated in the previous section, the Product, Category and Shop page names appear in URLs for the SXA storefront. If you change the name of the Product, Category or Shop page in the Content Editor, you must update the catalog configuration in the /sitecore/Commerce/Commerce Control Panel/Storefront Settings/Storefronts/<Storefront>/Catalog Configuration item, in the Shop Pages Root Paths section.

Shop Pages Root Paths settings in Catalog configuration.
Important

After you have updated the configuration and published the site, to see the results in the storefront, you must clear your browser cache before navigating to the site.

Do you have some feedback for us?

If you have suggestions for improving this article,