Salesforce B2C Commerce enables you to encode most characters used in URLs. B2C Commerce automatically encodes special or reserved characters, or umlauts in URLs, but doesn't remove them.
If you use product or category names to construct your URLs, you can configure whether spaces in names are encoded with '%20' or replaced by another character, such as a hyphen. You can also configure whether all characters should be converted into lower case and all URLs have a trailing slash. The characters allowed or disallowed in URLs applies to all B2C Commerce URLs, whether you are using the standard syntax, the search-friendly URL syntax, or the URL Rules URL syntax.
Character | Description |
---|---|
- | Minus |
. | Period |
, | Comma - The comma can generally be used, except for the
Product-ShowInCategory pipeline that requires two parameters, in
which case category ID must not contain a comma. Note: Salesforce recommends not using commas in object IDs
to avoid possible problems with custom pipelines that require
multiple parameters.
|
_ | Underscore |
# | Number sign |
< | Less than |
> | More than |
% | Percent |
$ | Dollar Sign |
: | Colon |
; | Semicolon |
= | Equal sign |
While it's possible to use other characters in product IDs, Commerce Cloud generally recommends using alphanumeric characters in product and content IDs, because they can cause URLS to not be generated correctly.
Characters Disallowed in SEO URLs:
&
- ampersandCharacter Encoding Rules
B2C Commerce supports UTF-8 and ISO-8859-1 encodings. All other encodings supported by Java virtual machines are expected to work, but are not officially supported. See URL Syntax for information on specifying ISO or other encodings as part of a URL.
/
) are not encoded and stay in
clear text in generated URLs.+
) is encoded according to the
current system configuration for the space substitution
character.These examples assume that the URLs use the default configuration and you can assume all encoded URLs are prefixed by the protocol and host name.
${name}/${productID}
Name | ID | Encoded URL |
---|---|---|
PRODUCTäNAME | ID+ID | PRODUCT%C3%A4NAME/ID%20ID |
PRODUCT NAME | ID&ID | PRODUCT%20NAME/ID%20ID |
PRODUCT&NAME | ID?ID | PRODUCT%20NAME/ID%3FID |
PRODUCT+NAME | ID ID | PRODUCT%20NAME/ID%20ID |
PRODUCT%NAME | ID/ID | PRODUCT%25NAME/ID/ID |
PRODUCT/NAME | ID%ID | PRODUCT/NAME/ID%25ID |
PRODUCT-NAME | ID-ID | PRODUCT-NAME/ID-ID |