Skip to main content

Configure URL Redirects

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain when to use URL redirects.
  • List the choices you have to redirect from source to target URLs.
  • Explain when to use static or dynamic mappings.
  • Explain sources and targets within URL Redirect mappings.
  • Describe when B2C Commerce automatically processes redirects.

URL Mappings

Brandon Wilson, a Cloud Kicks merchandiser, is excited by his company's acquisition of a boutique sports equipment company. While the fabulous new sports equipment fits nicely with Cloud Kicks product offerings, the shopper experience—jumping from one storefront to another—is not ideal.

During the initial transition between the two sites, he wants to create 301 redirects from the old to the new. He plans to use host aliases, static mappings, or mapping rules to do this. He wants to map the legacy URLs in bulk and redirect the URLs to maintain SEO value for the acquired company’s high traffic pages.

At the same time, he wants to change a category name in the existing storefront to be more inclusive of the new products. That means redirecting existing B2C Commerce URLs.

Redirects

When you redirect, there’s a source URL and a destination URL. This table shows the features that Brandon can use based on his source URLs.

Source URL

Mapping feature

Salesforce B2C Commerce

URL redirect functionality, URL archive (automatic), search refinement redirects (automatic)

A legacy platform different from B2C Commerce

B2C Commerce hostname aliases and static and dynamic mappings

Static and dynamic mappings have much the same functionality. Dynamic mappings, however, can extract content from wildcards within the source URL (for example, /mens/*/clothing/) into the destination URLs, which makes them dynamic.

Brandon uses static mappings for content pages or a unique or unusual page, and dynamic mappings for product or category pages or pages that conform to a pattern. B2C Commerce has a quota limit of 50,000 URL redirects and around 18K static and 18K dynamic mappings per site.                  

Configure URL Redirects

Brandon uses the Business Manager URL Redirect module to create redirects from existing B2C Commerce URLs to new B2C Commerce URLs. Let’s take a look at some examples.

Example: Redirect Category Landing Pages

Brandon wants to redirect the cloudk-sports-equipment category page to the renamed sports-equipment category page. Here’s how he does it.

  1. Open Business Manager.
  2. Select site > Merchant Tools > SEO > URL Redirects.
  3. Click New.
    Business manager, SEO URL redirects

  4. Configure these settings:
    1. Source Type: Category
    2. Category ID: sports-equipment
    3. Destination Type: Category
    4. Category ID: ck-sports-equiptment
    5. Copy Source URL Parameters: Default (No)
    6. Redirect Type: Permanent (301)
    7. Enabled: select

This is the source (incoming) URL: www.cloudkicks.com/sports-equipment.

Within a URL Redirect mapping, it’s best practice to define IDs (such as catalog or product IDs) and let B2C Commerce create the redirect URL. It might seem like a good idea to define the redirect target as URL directly (via the URI/URL settings), but mappings can change.

Bulk Change After a Compare

Brandon wants to make some bulk URL changes after a compare. It turns out that he can create redirects for two types of changes: value changes, such as Blue to blue, and removal.

Here’s how to do it.

  1. Open Business Manager.
  2. Select site > Merchant Tools > SEO > URL Rules.
  3. Click the URL Search Refinements tab.
  4. To compare the use of a specific refinement value, enter the value you want into the Refinement Value field and click Find.
  5. Enter blue and click Compare.
  6. With the changed items showing, select one or more URL refinement values to change.
  7. Click Create Redirects.
  8. Click OK.
    The new redirects appear, based on the URL type and enabled refinement you selected, in the Search Refinement Redirects section.

URL Archive

The URL archive functionality automatically redirects outdated category and folder URL mappings. This feature is enabled on staging and production instances, where B2C Commerce automatically saves category and folder URL mappings when they become outdated, and can redirect them to new mappings.

Here’s how to delete or view outdated mappings.

  1. Make sure you are on a staging instance (this functionality is not available on other instance types).
  2. Open Business Manager.
  3. Select site > Merchant Tools > SEO > URL Rules.
  4. Click the URL Archive tab (this only appears on a staging instance).
  5. Delete or view the mappings.

Dynamic Mappings

Dynamic mapping rules use a pattern to identify a URL from a legacy site and automatically redirect it to a B2C Commerce URL. Brandon uses this to redirect a large number of similar URLs (for example, all the URLs in a specific category). To redirect a specific URL, it's more common to use static mappings.

Note

You can’t use this method to map from one B2C Commerce URL to another or to create redirects for static resources such as images.

Create Mapping Rules

Cloud Kicks acquired the sports equipment company because it’s wildly successful. Mapping rules help preserve SEO rankings accumulated by this company on its existing platform as it transitions to the new B2C Commerce platform. Cloud Kicks used this same strategy in its early days when it moved from the legacy system to the B2C Commerce system.

Brandon’s first task is to google the acquired site’s top-selling categories and products. He uses the links that appear on the first page of each search as the list of links to redirect. Once he has his list, he identifies patterns that he can use in his rules. For example, if there are lots of links in one category or subcategory, he can create a mapping rule to redirect products in those categories from the old site to the new.

Mapping Rule Syntax

Each mapping rule is made up of a URL pattern and a B2C Commerce URL template, separated by a white space. The URL pattern identifies the incoming URL, and the URL template generates the B2C Commerce URL for the redirect. You can add options between the pattern and template.

Pattern

Option

Template

/index.asp?ID=576416&Cat=hockey.html

ie=iso-8859-1

/sports-equipment/576416,default,pd.html?cgid=Hockey

You can reference any part of the source URL matched by a wildcard (*,**) by its position in the URL, using a numbered parameter in the template ({0}). Wildcards match any text between forward slashes in the URL that isn't a query string.

For example, Brandon wants to redirect products in the hockey category from the acquired site to his new site. He uses the same product ID and category name as in the source site.

Source URL

http://www.sports-equipment.com/catalog/product/index.asp?ID=576416&Cat=hockey.html

B2C Commerce (target) URL

http:///www.cloudkicks.com/sports-equipment/576416,default,pd.html?cgid=hockey

Source URL Pattern

A source URL pattern contains some or all of the URL, with wildcards replacing portions of it. The pattern can be an absolute pattern, including a protocol and host name, or a relative pattern without a host name, starting with /.

Use wildcards to have one mapping represent many URLs dynamically by parsing variables from the original source URL. Here are the wildcards.

Wildcard

Meaning

*

Match any characters up until a forward slash /. Query strings and parameters are not matched.

**

Match any characters inclusive of forward slashes /. Query string and parameters are not matched.

Static Mappings

Brandon wants to create static mappings from the acquired system URLs to the B2C Commerce URLs. The source URLs can be static resources, but they must be unknown to the B2C Commerce system.

Here’s what static mappings look like.

Business Manager, SEO static mappings

Each line in a mapping contains one mapping definition where both parts are separated by a white space. You can add a comment line by using an ASCII # or ! as the first non-white space character in the line. You can map URLs that contain white space by surrounding the white space with single quotes.

Mapping with wildcards is only valid if they begin or end the URL, but not both. For example, **/a-sample-url** is an invalid mapping.

Static resources follow this syntax:

<legacy URL> [i] s,[<protocol>],[<host>],[<unit>],[<locale>],<path>=

Let's Wrap It Up

In this unit you explored the many ways you can map URLs in Business Manager, both manually and automatically. In this module you explored the many aspects of B2C Commerce SEO URLs. Now take the final test and earn your badge.

References

Teilen Sie Ihr Trailhead-Feedback über die Salesforce-Hilfe.

Wir würden uns sehr freuen, von Ihren Erfahrungen mit Trailhead zu hören: Sie können jetzt jederzeit über die Salesforce-Hilfe auf das neue Feedback-Formular zugreifen.

Weitere Infos Weiter zu "Feedback teilen"