Testing Dynamic URL Mappings for Source Codes

You can support a friendly URL that a customer can enter. This URL takes the customer to a specific page that shows the results of the search of category JA, for example. You should test a dynamic URL mapping.
  1. Select site > Merchant Tools > Online Marketing > Source Code Groups.
    1. On the Source Codes Groups page, click Find to view the list of source code groups.
    2. Open the selected source code group.
    3. On the Codes tab, enter SpringSale into the Source-Code Specification field and click Add.
    4. On the Redirects tab, select the Active: Category option, enter the JA category code, and click Apply.
  2. Select site > Merchant Tools > SitePreferences > Source-Codes.
    1. On the Source Code Preference page, enter src into the URL Parameter Name field.
    2. Enter http://www.yourstore.com/specials/ into the Standard Redirect URL field.
    3. Click Apply.
  3. Select site > Merchant Tools > Site URLs > Aliases.
    1. On the Aliases page, enter www.yourstore.com.
    2. Click Save.
  4. Select site > Merchant Tools > Site URLs > Dynamic Mapping.
    1. On the Dynamic Mapping page, enter /specials/?src=* p,,,SourceCodeRedirect-Start,,src,{0}.
    2. Click Save.

    What appears on the left side of the space characters (/specials/?src=*) is only a fragment of a URL. Salesforce B2C Commerce searches through the aliases list to find an entry (in this case, www.yourstore.com) that can complete the URL. B2C Commerce then interprets src as a parameter and knows to give it the value "SpringSale".

    The left side of the space character is replaced by the codes on the right side. B2C Commerce interprets the right side of the assignment as an instruction to go to the Start node of the SourceCodeRedirect pipeline and pass in the value of the source code in the calling URL. While src is the name of the parameter, {0} references the first argument of the URL.

  5. Select site > Online Marketing > Source Code Groups.
    1. On the Source Codes Groups page, click Find to show the list of source code groups.
    2. Open the selected source code group.
    3. On the Codes tab, enter a test source code into the Source-Code control and click Test Match.
    One or more sample Redirect URLs are listed at the bottom of the page. Copy one sample URL at a time into the navigation bar of your browser to test how it behaves.