Kentico CMS 7.0 Developer's Guide

URLs

URLs

Previous topic Next topic Mail us feedback on this topic!  

URLs

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

URLs tab fields:

 

Document alias

The unique name of the document in the given section of the website. By default, this alias is not changed when you modify the document name. The alias is used for the following purposes:

 

1.To define the alias path, which is the unique path to the document. Developers typically use the alias path in the Path property of certain web parts and controls.

 

2.For the URL of the document. The URL of the document is like:
www.kentico.com/products/cms.aspx
 
Where /products/cms is the alias path of the document.

 

Forbidden characters

 

Some characters are forbidden in URLs and thus they are replaced by a safe character (by default, it's a dash -). You can specify the forbidden characters and the replacement character in Site Manager -> Settings -> URLs and SEO through the Forbidden URL characters and Forbidden characters replacement properties.

Document URL path

If you want to use a specific URL for a document that doesn't depend on its Alias path, you need to check the Use custom URL path box and enter a different value.

 

You can choose from the following Path types for the custom URL:

 

Standard URL or wildcard - the URL will be handled by the standard Kentico CMS rewriting engine.

Route - the URL will be processed as an ASP.NET Route pattern.

MVC - requests to the URL will be handled as requests for an MVC page. Please see the MVC development model chapter for more information.

 

The selection made here determines how the value of the Path or pattern field will be processed. For MVC or Route patterns, it is always necessary to include the URL extension at the end of the path. If you leave the path without an extension, the document will automatically be available under an extensionless URL.

 

If MVC is selected, you must also specify the following values:

 

Default controller - the name of the MVC controller containing the action that should be performed when the alias URL is accessed, without the Controller part at the end. For example, if the class is called NewsMVCController, enter NewsMVC. The system first searches for the specified class in the CMS.Controllers.<current site code name> namespace. If it is not found there, the CMS.Controllers.Global namespace is searched.

Default action - specifies the action defined within the controller that should be performed when the document is accessed under this URL.

 

The URL path must always start with /. When entered, the document will be accessible under two URLs. This can be useful if you need to define a short URL for a page or need to optimize the URL for search engines.

 

The URL path is culture‑specific, unlike the alias path. This means that if you use URL paths:

/product (for the English version)

/produkt (for the German version)

 

Then when the user comes to /produkt.aspx, the language of the website will automatically be switched to German.
 
The URL path may contain wildcard URLs or MVC or Route patterns. Wildcards use the following format: {wildcard} or {wildcard;defaultvalue}, where wildcard is the name of the wildcard and defaultvalue its value if the URL is used without a wildcard being entered. More information can be found in the Wildcard URLs topic.

URL extensions

Default URL extensions are defined in Site Manager -> Settings -> URLs and SEO -> Friendly URL extensions. If you check the Use custom URL extensions check box, you can define other extensions under which the document can be accessed.

 

In case that the option is disabled, physical file extensions can also be used for cms.file documents.

 

Multiple extensions can be entered divided by a semicolon. If you enter a semicolon without any extension, extensionless URLs will be allowed.

 

Example: entering .htm;; for a document with a URL path set to /test will allow the document to be accessed through both of the URLs below:

 

<site path>/test.htm

<site path>/test

 

For this to work, you also need to to set up your IIS for handling 404 and 405 errors as described in the Installation and deployment -> Additional configuration tasks -> Custom URL extensions chapter.

Document aliases

This section displays a list of other document aliases under which the document can be accessed. One document can have an unlimited number of aliases. You can edit (Edit) and delete (Delete) aliases in the list or NewTransformation_6.0 Add new alias.

 
If the Remember original URLs when moving documents setting is enabled in Site Manager -> Settings -> URLS and SEO, new document aliases containing the original URL properties will automatically be created whenever the Document URL path or URL extensions properties are changed.

 

More information about document aliases can be found in the Multiple document aliases topic in the Development -> Page processing and URLs chapter of this guide.