---
title: Extensionless and custom URLs
---

> 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).

You can configure the system to use extensionless URLs or custom URL extensions.

## Setting up extensionless URLs

URLs without extensions are the standard for most websites. For example: _http://www.example.com/news_

To use extensionless URLs, you only need to adjust the settings in the Kentico administration interface:

> **Info:** Make sure that your server fulfills the [minimum system requirements](https://docs.kentico.com/k10/installation/server-and-hosting-requirements.md) (when using IIS 7.5, the operating system must have Service Pack 1 installed).

1. Open the **Settings** application.
2. Select the **URLs and SEO** category.
3. Set the **Friendly URL extensions** setting to an _**empty value**_.
4. Click **Save**.

Now when you go to the live website, the system renders all URLs in menus and listings without an extension. You may need to manually update static links that were created with the default **.aspx** extension.

## Using custom URL extensions

Custom URL extensions allow you to change the default _.aspx_ extension to _.html_, _.asp, .php_, or any other value.

For example, instead of the default _http://www.example.com/news_\*.\*_aspx_, you can have URLs ending with ._html_:

_http://www.example.com/news.html_

To use custom URL extensions, take the following steps:

1. Adjust your web.config (IIS) to handle custom extensions
2. [Configure custom URL extensions in the Kentico settings](#setting-custom-url-extensions)

### Configuring IIS to allow custom extensions

1. Edit your application's **web.config** file.
2. Find the **** element inside the **system.webServer** section directly under the web.config root (i.e. not under a specific __ element).
3. Set the **runAllManagedModulesForAllRequests** attribute to _true_ for the opening __ tag:

   ```html

   <system.webServer>
     ...
     <modules runAllManagedModulesForAllRequests="true">
       <remove name="WebDAVModule" />
       <remove name="XHtmlModule" />
       <remove name="CMSApplicationModule" />
       ...
     </modules>
   ...
   </system.webServer>

   ```

You can now configure the extensions in the Kentico administration interface.

### Setting custom URL extensions

Once you have performed the required low-level configuration, set the URL extensions in the Kentico administration interface:

1. Open the **Settings** application.
2. Select the **URLs and SEO** category.
3. Type the required extension into the **Friendly URL extensions** setting, for example: _.html_
4. Click **Save**.

Now when you go to the live website, the system renders all URLs in menus and listings with the specified extension. You may need to manually update static links that were created with the default **.aspx** extension.

#### Using multiple extensions

You can enter multiple extensions into the **Friendly URL extensions** setting. Use the following rules:

- The first extension is used as the default.
- Enter other extensions, separated by semicolons. Pages can be accessed through URLs ending with all entered extensions.
- To allow extensionless URLs in combination with other extensions, enter a semicolon without an extension.

Examples:

- **;.aspx** - extensionsless URLs by default, also allows _aspx_
- **.html;.htm;;.asp** - _html_ extension by default, also allows _htm_, extensionless and _asp_

If you enable the **Redirect pages to main extension** setting in **Settings -> URLs and SEO**, the system redirects URLs with non-default extensions to the corresponding URL with the default extension. This can be useful for SEO purposes. For example, if you want to change your site's URL extension, and use the new extension when the pages are accessed from a search engine that has your website indexed with the old extension.

#### Page-level extension settings

In addition to the global settings, you can set URL extensions for individual pages. The default extension that appears in the browser address bar when opening pages is always taken from the global settings.

1. Open the **Pages** application.
2. Select the page in the content tree.
3. Switch to the **Properties -> URLs** tab.
4. Select the **Use custom URL extensions** check box.
5. Type the required extensions using the same rules as described above.
6. Click **Save**.

> **Note:** Even if the **Use custom URL extensions** option is disabled, files (**cms.file** pages) can be accessed under their physical extensions.

## Advanced URL extension settings

By default, the system keeps the URL extension (or extensionless URL) even when a **postback** occurs on the page. However, certain legacy environments had problems processing postbacks with custom URL extensions. To prevent such problems, the system can automatically add the **.aspx** extension to URLs when a postback occurs. If you need to force the .aspx extension for postback URLs, add the following key to the _appSettings_ section of your web.config file:

```html

<add key="CMSUseExtensionOnPostback" value="true" />

```

If you are using trailing slashes (enabled through the **Use URLs with trailing slash** setting in **Settings -> URLs and SEO**), you can configure the system to only add the trailing slash for extensionless URLs. Add the following key to the _appSettings_ section of your project's web.config file:

```html

<add key="CMSUseTrailingSlashOnlyForExtensionLess" value="true" />

```

With the key set to _true,_ URLs with an extension do not have the trailing slash appended.
