---
title: Configuring forbidden URL characters
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The system provides settings that allow you to configure what characters are allowed in URLs. These setting apply to either [routing mode](https://docs.kentico.com/13/developing-websites/implementing-routing.md).

Certain characters have special meanings in URLs, so they cannot be used in values that determine URLs. The system automatically replaces or removes forbidden characters in:

- Page [URL slugs](https://docs.kentico.com/13/managing-website-content/working-with-pages/managing-page-urls.md)
- [Page aliases](https://docs.kentico.com/13/developing-websites/implementing-routing/custom-routing-using-url-patterns/identifying-pages-based-on-url-parameters.md)
- [Attachment URLs](https://docs.kentico.com/13/developing-websites/retrieving-content/displaying-page-attachments.md)

By default, the following characters are forbidden:

```text

\/:*?"<>|&%.'#[]+=„" and the space character
```

To specify additional forbidden characters:

1. Open the **Settings** application.
2. Select the **URLs and SEO** category.
3. Type the characters into the **Forbidden URL characters** setting (without any separator).
4. Click **Save**.

Alternatively, you can enter a [regular expression](http://en.wikipedia.org/wiki/Regular_expression) into the **Allowed URL characters** setting to precisely specify which characters are allowed in URLs.

> **Note:** **Note**
>
> The default characters listed above are always forbidden unless you override the **CMSForbiddenURLValues** key in the _/configuration/appSettings_ section of your administration application's web.config file. For example:
>
> ```html
>
> <add key="CMSForbiddenURLValues" value="$\/:?&quot;&lt;&gt;|&amp;%.&apos;#[] =" />
>
> ```
>
> You can either use the key to allow some of the default forbidden characters, or add new ones. It is _**strongly recommended to keep the default characters forbidden**_ – entering the characters into URL values may prevent certain types of URLs from working correctly.

You can specify the character that is used to replace forbidden characters through the **Forbidden characters replacement** setting in **Settings -> URLs and SEO**. 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 character. If you wish to have each forbidden character replaced individually, add the following key to your administration application's web.config:

```html

<add key="CMSLimitUrlReplacements" value="false" />

```

## Alternative page URLs

The settings and configuration described above do NOT apply to alternative URLs of pages. Instead, the allowed and forbidden characters in alternative URLs are controlled by the **Alternative URLs constraint** setting in **Settings -> URLs and SEO**. For more information, see [Enabling alternative URLs for pages](https://docs.kentico.com/13/developing-websites/implementing-routing/enabling-alternative-urls-for-pages.md).
