You are here:
Characters Allowed in URLs
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 are converted to 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.
B2C Commerce URL Encoding of Product or Content IDs
The following characters are allowed in product or content IDs and are handled by search-friendly URL generation.
| 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. |
| _ | 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, we generally recommend using alphanumeric characters in product and content IDs, because they can cause URLS to not be generated correctly.
B2C Commerce URL Encoding of Marketing Text
Characters Disallowed in SEO URLs:
-
&- ampersand - ASCII control characters (ASCII code: 0x00-0x1F, 0xF7). For example, NULL, tab, or other invisible control characters are not allowed in SEO URLs.
Character 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.
B2C Commerce uses the following rules when encoding text in SEO URLs.
- All visible special ASCII characters except disallowed characters. If a disallowed character is present, it's replaced by a space replacement character ('+' or %20).
- Spaces at the beginning and the end of the marketing text are removed and multiple spaces compressed into one.
- Standard UTF8 URL encoding applies, using a space substitute (%20, +) that you configure.
- Forward slashes (
/) are not encoded and stay in clear text in generated URLs. - The plus sign (
+) is encoded according to the current system configuration for the space substitution character.
These examples assume that the URLs use the default configuration and assume all encoded URLs are prefixed by the protocol and host name.
The SEO Definition for all of the following URLs is:
${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 |

