Creating a URL strategy for your catalog pages
Sitecore Discover lets you create pages where the content is entirely URL driven. This means that the content displayed on a page is explicitly related to the path and query parameters of the URL. The content in the following Discover page types is defined by the page URL:
-
Product listing page
-
Landing page
An efficient URL strategy immediately informs the visitor of the page contents, in addition to improving SEO.
For your URL strategy to be successful, it must reflect the structure and contents of your product catalog. You can include product attributes, values, and query parameters in the URL path. You can also construct URLs that include string literals and soft filters.
The following are some examples of common URL strategies.
URL with attribute values only
You can create URLs that use attributes values only, as shown in the following:
-
www.domain.com/{attributeValue} -
www.domain.com/{attributeValue1}/{attributeValue2}/{attributeValue3}/{attributeValue4}
The following shows an example of a URL that contains attribute values only, where the attribute names are brand and category with values gucci and shirts respectively:
www.domain.com/gucci/shirts
Do not use this strategy if two or more attributes have the same value. The values for all attributes must be unique. For example, if the attributes brand and category both have the value gucci, the URL does not communicate the pattern.
URL with hierarchical attribute values
If your catalog structure uses a parent-child category hierarchy, using attribute values that reflect that hierarchy is an excellent strategy. For search engine optimization, we recommend that you use a hyphen ( -) as the hierarchical category separator, for example:
-
www.domain.com/{parentCategoryValue} -
www.domain.com/{parentCategoryValue}-{childCategoryValue}
The following shows an example of a URL using the hierarchical categories type, gender, and subtype with values clothing, mens, and shirts, respectively:
www.domain.com/clothing-mens-shirts
Do not use this strategy if your category values have more than one word.
URL with attribute names and their values
You can build the URL that is formed by sequentially listing the name-value pairs of attributes, and separate each pair using a slash character (/), as shown in the following:
www.domain.com/{attributeName1}/{attributeValue1}/{attributeName2}/{attributeValue2}
The following shows an example of a URL containing attribute names and values, where the attribute names are department, clothing-type, and color, and the values are clothing, and shirts, and red respectively:
www.domain.com/department/clothing/clothing-type/shirts/color/red
Do not use this strategy if an attribute name and any attribute values are the same.
URL with unique string literals
You can form the URL by simply using unique sting literals, without expressing any attribute names and values, as shown in the following:
-
www.domain.com/{string-literal} -
www.domain.com/{string-literal-1}/{string-literal-2}
The following shows an example of a URL containing the unique string literals "thanksgiving-black-friday-2022" and clothing-sale:
www.domain.com/thanksgiving-black-friday-2022/clothing-sale
URL using soft filters
You can build a URL as a combination of attribute values and soft filters giving users the ability to narrow down search results, as shown in the following:
-
www.domain.com/{attributeValue}?{softFilter}
The attribute value is part of the URL and the soft filter (name-value pair) is passed as a query parameter. To change the page content, the user can change the soft filter values in the URL.
The following example shows a URL where shirt is the attribute value and color=red is the soft filter (name-value pair):
www.domain.com/shirts?color=red