Kentico CMS 6.0 Developer's Guide

URL format and configuration

URL format and configuration

Previous topic Next topic Mail us feedback on this topic!  

URL format and configuration

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Defining the extension of URLs

 
The URLs can use various extensions. By default, all URLs end with .aspx, such as: http://www.example.com/products/kentico-cms.aspx

 
You can also use custom extensions, such as .htm, .html or any custom extension. Alternatively, you can even use URLs without extensions, such as http://www.example.com/products/kentico-cms. However, in this case, you need to configure the system as described in Configuration of custom URL extensions.
 

Excluding URLs from the CMS engine

 
If you need to add your own pages to the website, you may need to exclude them from CMS engine processing. You can do that by adding the page URL (without extension) to the Site Manager -> Settings -> URLs and SEO -> Excluded URLs value (you can enter several URLs separated by a semicolon (;).
 

Forbidden URL characters

 

URLs (document aliases and URL paths) cannot contain certain special characters. By default, the following characters are forbidden:

 

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

 

If needed, you can add additional forbidden characters by entering them (without any separator) into the Forbidden URL characters setting in Site Manager -> Settings -> URLs and SEO. Alternatively, a regular expression may be entered as the value of the Allowed URL characters setting to precisely specify which characters should be allowed in URLs.

 

Please note that the default characters listed above will always be forbidden unless you override them through the CMSForbiddenURLValues key, which can be added to the /configuration/appSettings section of your application's web.config file. For example:

 

<add key="CMSForbiddenURLValues" value="$\/:?&quot;&lt;&gt;|&amp;%.&apos;#[] =" />

 

Through this key, you may either allow some of the default forbidden characters or add new ones. It is recommended to keep the default characters forbidden, since they may prevent certain types of URLs from working correctly if entered into URL paths.

 

Forbidden characters are automatically replaced or removed. You can specify the character that is used to replace forbidden characters through the Forbidden characters replacement setting in Site Manager -> 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, you can add the following key to your web.config:

 

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

 

This preference may also be set specifically for the Document URL Path property of documents (and no other URLs) via the key below:

 

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

 

Using URL Prefixes

 
If you need to add a prefix to all URLs (e.g. for search engine optimization), you can specify it in the Site Manager -> Settings -> URLs and SEO -> Default Url Path Prefix field.

The URLs will then look like this: http://www.example.com/myprefix/products/kentico-cms.aspx

 

Automatic creation of new document aliases

 

If you check the Site Manager -> Settings -> URLs and SEO -> Remember original URLs when moving documents check-box, new document aliases will automatically be created when a new extension or URL path is set.

 
Using language prefixes for URLs

 

If you wish to add a different URL prefix for every document culture version, you can specify it in the Site Manager -> Settings -> URLs and SEO -> Use language prefix for URLs field. If you have both language prefixes and standard URL path prefixes enabled, the standard URL prefix always precedes the language prefix in the URL. Please refer to the Multilingual and international support -> Languages and URLs topic for more details.
 
URL related settings

 
The above configuration tasks can be performed in Site Manager -> Settings -> URLs and SEO. The following table contains some of these settings and provides descriptions for them:
 

URL format

Forbidden URL characters

List of additional characters that cannot be used in URLs (document aliases and URL paths). The following characters are forbidden by default: \/:*?"<>|&%.'#[]+= and the space character.

Forbidden characters replacement

Specifies the character that will be used as a replacement for forbidden characters in URLs.

Allowed URL characters

Determines which characters are usable in URLs by means of a regular expression. Any characters not specified will be forbidden. If empty, only the characters specified by the Forbidden URL characters setting will be prohibited.

 

When allowing special characters in the regular expression, they must be preceded by a backslash (\) as an escape character.

 

Example: Entering a-zA-Z0-9\^ as the value would only allow alphanumeric characters and the caret symbol (^) to be used in URLs.

Friendly URL extension

Specifies the extension of friendly URLs. The extension should be preceded by a dot when entered, such as: .aspx or .html. When you omit this value, the friendly URLs will be the same as the alias path (e.g. /products/nokia).

Please note: The system of “friendly” or “smart” URLs provides several benefits. They are easy to remember and easy to write into the browser address bar. They are search engine friendly (SEO friendly). They show users where they are located on the website. You can easily send the URL of the document to your friend and she will see the same page with the particular document.

Files friendly URL extension

Specifies the extension for files that will be used in friendly URLs, such as ".aspx" or ".html".

 

Example: getfile/<node alias>/myimage.aspx

 

When you omit this value, the friendly URLs of files will end with no extension: getfile/<node alias>/myimage

Excluded URLs

List of URLs (without domain) that should be excluded from the CMS engine. You can enter several paths separated by a semicolon (;).

Document URLs

Default URL path prefix

Defines a default URL path prefix that will be used for all URLs of the content pages. This prefix is rewritten to urlpathprefix query string parameter.

Use name path for URL path

If checked, this key indicates that a document's name path will automatically be copied to its URL path.

Use permanent URLs

If enabled, URLs of documents and document attachments will be generated in permanent format; if disabled, friendly URLs will be used. Learn more at Linking pages and files.

Remember original URLs when moving documents

Determines if new document aliases should be created when a new document URL path or extension is set.

Automatically update document alias

If enabled, the alias of a document is automatically updated to match any changes in the name of the given document in the default culture. Also, the document alias property will not be editable manually.

 
SEO related settings can be found in the Search engine optimization chapter.