Work with URLs
Describes how to work with URLs in Optimizely Configured Commerce.
Optimizely Configured Commerce uses a set of conventions to generate URLs for website pages. These different conventions are identified and explained below, along with how each URL is crafted.
A URL (Universal Resource Locator) is a unique address comprised of parts intended to direct a user to a certain location for internet content. A URL looks like this:
www.example.com/catalog/category/potentialsubcategory/productname
URL Structure
Configured Commerce follows two general strategies for creating URLs. The first strategy is employed when the URL is intended to resolve to a certain product or category. The URL is constructed with the following components:
www.example.com/catalog/category/potentialsubcategory/productname
- www. - Designates the specific type of host server. This shows that the web page is a World Wide Web server
- domain (such as example or website name) - Designates the website's name. In Configured Commerce, this domain is set in the Admin Console within the Details finger tab of a selected website
- .com - Top level domain used for organization
- /catalog/ - Designates that the URL is going to resolve to a product or category
- /category/ - Determines the parent category that is visited or the parent category for the product. The text entered in Catalog > Categories > Details tab > Name field appears here.
- /potentialsubcategory/ - Used for any subcategories that may be associated with the parent category. There may be multiple sections for these subcategories in the URL. Each subcategory is appended to the end of the string until there are no more subcategories and are justified going left to right. If the product is only in a top-level category, this section does not exist. The text entered in Catalog > Categories > Details tab > Name field appears here.
- /productname - Designates the Product Name. The text that is entered in Catalog > Categories > Details tab > Name field appears here.
- Product segment URLs allow for the following special characters:
- a-z
- A-Z
- 0-9
- - _ ( ) /
- Any other characters used are automatically converted to dashes
Given these components, a URL for a pair of shoes might look like this in Configured Commerce:
www.shoes.com/catalog/mens/leather/brownwingtip
A URL that directs someone to a general category might look like this in Configured Commerce:
www.hardwarestore.com/gardening/shovels
The second way URLs are typically constructed in Configured Commerce is much more basic, and intended to be used when a URL resolves to a content-managed page (such as AboutUs) or a predefined content page. In cases like this, the page name is added to the end of the URL, and is made up of the following components:
www.example.com/pagename
- www. - Designates the specific type of host server. This shows that the web page is a World Wide Web server
- domain (such as example or website name) - Designates the name of the website. In Configured Commerce, this domain is set in the Admin Console within the Details finger tab of a selected website.
- .com - Top-level domain used for organization
- /pagename - Designates the page you are going to in Configured Commerce. It is either the name of a predefined content page, or the name that was given to a content-managed page when it was created.
Given these components, a URL for an About Us page might look like this in Configured Commerce:
www.bestcompanyever.com/aboutus
Other URL considerations
If your Configured Commerce website is using the Subdomain or Microsite functionality, you may notice a few differences with your URLs. When you use a Subdomain, the subdomain is added to the front of the URL:
subdomain.example.com/catalog/category/product
If you are using microsites with your Configured Commerce website, the microsite identifier is added after the top-level domain of the website in the URL:
www.example.com/micrositeidentifier/catalog/category/product
Occasionally, page URLs can be appended and modified by a feature to allow the feature to function. For example, when you are using an Attribute filter to filter a page, Configured Commerce adds information to the end of the URL:
www.example.com/catalog/shoes/mens?categoryID=CategoryGUID&Filters=FilterGUIDs&sortby
As you can see, different sections are added to the URL string based on the Category being viewed, and the filters currently being used on the data in the page. These appended pieces are not intended to be part of the address that is resolved; they are used to allow data to be modified.
Page URLs also are appended when using the CMS shell:
www.example.com/ContentAdmin/Shell?frameURL=
In this instance, for Configured Commerce to know that it has to use the CMS editor, it appends /ContentAdmin/Shell?frameURL to the URL. Again, this URL is not intended to be used to go to directly. It is only appended under certain circumstances when the User is actively using the CMS shell.
Updated 10 months ago