Create a Redirect from a Salesforce B2C Commerce URL

The URL redirects feature redirects obsolete or unavailable B2C Commerce pages to currently available pages, or to a specific URL outside B2C Commerce.

To use this feature, you must have the correct site-level permissions.

This feature is not intended for redirects from external platforms. For more information on redirecting URLs from an external platform, see URL Redirects.

Note: URL redirects must be replicated from Staging to Production.
Tip: Commerce Cloud recommends always using a single redirect from a source page to a destination page. Redirect chaining can cause search engines to deindex pages or parts of sites if used indiscriminately. A customer reaching your site might already have encountered one or more off-site redirects, which are outside of your control, so it's safer to simply use a single redirect.
Note: Configure the default setting by selecting site > Merchant Tools > Site Preferences > Storefront URLs.
  1. Select site > Merchant Tools > SEO > URL Redirects.
  2. Do one or more of the following:
    1. Click New to create a URL redirect.
    2. To locate an existing URL redirect, enter a search term and click Find.
    3. To perform a more detailed search for an existing URL redirect, click Advanced.
      In the URI Search Term box, enter one or more words that identify the URI you want to redirect. Checking that the URI doesn't already have a redirect prevents you from creating a duplicate redirect.
    4. To validate that all redirects are configured to redirect to an existing category, product, or content item, click Find Invalid Redirects.
    5. Click Edit to edit an existing URL redirect.
  3. On the Edit URL Redirect page, you can identify the source URI directly or specify the source type and ID.
    We recommend that you source type and ID for two reasons. First, all your redirects stay in place if you switch from standard URLs to search-friendly URLs. Second, because you can select your source IDs directly, there's less chance of a data entry error.
  4. Specify the source type; the next field changes based on your selection.
    Option Description
    URI | URI Enter the URI.
    Category | Category ID Enter the category ID or click the browse button to select one.
    Product | Product ID Enter the product ID or click the browse button to select one.
    Folder | Folder ID Enter the folder ID or select one from the list.
    Content | Content ID Enter the content ID or click the browse button to select one.

    For URI, enter the portion of the B2C Commerce URI after the host name and before the query string. B2C Commerce automatically selects the new URL that has the most parameters in common with the old URL.

    For example, if you want to redirect any products in the women's category:
    http://www.mystore.com/on/demandware.store/​Sites-YourShopHere-Site/​EN_US/Search-Show?_ie=iso-8859-1&cgid=womens

    Enter:

    /​EN_US/Search-Show?cgid=womens

    You can use an asterisk as a wildcard in the URI. Redirects with wildcards are processed after redirects without wildcards.

    See URL Redirect Processing and Examples for more examples and information about wildcards.

  5. Check the Enabled box.
  6. Specify the destination type; the next field changes based on your selection.
    Option Description
    URL | URL Enter the URL.
    Category | Category ID Enter the category ID or click the browse button to select one.
    Product | Product ID Enter the product ID or click the browse button to select one.
    Folder | Folder ID Enter the folder ID or select one from the list.
    Content | Content ID Enter the content ID or click the browse button to select one.
  7. You specify the URL you want to redirect to as an absolute or relative URL:
    • Absolute URL: The URL must begin with a protocol, for example, http://www.example.com.
      Note: Only the HTTP and HTTPS protocols are supported. Additional parameters must be specified in the Additional Parameters field, not in this field.
    • Relative URL: Similar to the URLs entered for the URI field, enter only the portion of the URL after the host name and before the query string. Additional parameters must be specified in the Additional Parameters field, not in this field.
  8. You can control if the Source URL parameters are copied to the Destination URL.
    Option Description
    Default The site preference is used. See Business Manager: site > Merchant Tools > Site Preferences > Storefront URLs. > Copy Source Parameters.
    No This overrides the site preference.

    Source URL parameters are not copied to the destination URL. The destination URL parameters are used as specified.

    Yes

    This overrides the site preference.

    Parameters from the request are added to the destination URL. For example, when the source URL is /mens/shoes?affiliate_code=123, and the destination URL is /gents/shoes, and the Copy source URL parameters setting is enabled for the redirect, then the actual destination URL is /gents/shoes?affiliate_code=123.

    Request parameters can't already be in the destination.

    The ID identifier must correspond. For example, if Product is configured as source and Category is configured as destination, then pid and cgid will not be copied from the original request. The Destination URL parameters are used instead.

    See Enabling Storefront URL Preferences.

  9. Select whether you want the redirect to be temporary or permanent.
    Option Description
    Permanent (301) redirects Retains the SEO trust and ranking of the source of the redirect. Although it might take some time for search engines to recognize the redirect, any dip in rank should be quickly reversed. Permanent redirects are never removed.
    Found/Temporary (302) redirects 302 redirects are used to retain SEO rankings for content that has permanently moved to a new URL. A 302 redirect does not retain the SEO trust and ranking of the source of the redirect. You should expect your SEO ranking for the page to drop until the new page has time to accumulate the same rankings and trust. A 302 redirect is temporary, because it's removed when the new URL has accumulated the same rankings and trust as the original URL. There is no expectation that the old URL will ever be used to access content ever again. For example, 302 redirects are used if you change the name of a category. B2C Commerce caches temporary redirects, but the browser does not.
    Temporary (307) redirects 07 redirects are used as a truly temporary redirect for a URL that is undergoing maintenance and will shortly be available again. A 307 redirect doesn't retain the SEO trust and ranking of the source of the redirect. You should expect your SEO ranking for the page to drop until the new page has time to accumulate the same rankings and trust. Temporary redirects are intended to be removed. B2C Commerce caches temporary redirects, but the browser does not. Use 307 redirects if the original content is temporarily removed and will be returned to the old URL. For example, if an article or microsite is removed for editing or updating and will shortly be available again.
  10. For Additional URL Parameters (if you select a URL destination type): enter parameters you want added to the end of the URL exactly as you want to see them. For example:
    &cgid=womens-accessories-scarves&prefn1=displaySiz
    Special characters are encoded before they are appended to the URL. Don't add the ? or & characters to the beginning of the entry; they are added automatically.
  11. Click Apply.
Note: We recommend that you check periodically for redirects that no longer have a valid destination. Do this by clicking Find Invalid URLs in the advanced search on the URL Redirects page.