In URLs, some characters are considered unsafe because they may be used for special purposes or could cause issues with browsers or servers. The system automatically replaces or removes forbidden characters in URL slugs and vanity URLs.
By default, the following characters are forbidden:
\/:*?"<>|&%.'#[]+=„“ and the space and tab charactersTo specify additional forbidden characters:
Alternatively, you can enter a regular expression (opens in a new tab) into the Allowed URL characters setting to precisely specify which characters are allowed in URLs.
The default characters listed above are always forbidden unless you override the CMSForbiddenURLValues key in your project's configuration file (appsettings.json by default). For example:
"CMSForbiddenURLValues": "\\/:*?\"<>|&%.'#[]+ ="Note: Support for the slash ('/') character in vanity URLs always requires additional configuration, even if the slash character is not included in the forbidden characters specified by the CMSForbiddenURLValues key.
You can either use the key to allow some of the default forbidden characters or add new ones. We strongly recommend keeping the default set of forbidden characters – entering the characters into URL values may prevent certain types of URLs from resolving correctly.
Support for the slash character in vanity URLs can't be configured through the CMSForbiddenURLValues key, but has to be enabled separately. When the setting below is enabled, the slash character is always allowed in vanity URLs, regardless of other settings.
To allow the slash character in vanity URLs:
Note:
The following vanity URL paths are always forbidden:
vanity//path)To specify forbidden character replacement:
By default, forbidden characters located at the beginning or end of the path are removed completely and consecutive forbidden characters are only replaced by a single replacement character. For example, "Articles*and%%%blogs" is replaced with "Articles-and-blogs" when using the default replacement character: '-' hyphen. If no replacement character is specified, the underscore '_' character is used.