Setting document aliases

Pages (documents) can have an unlimited number of different URLs. To configure URLs, select a document in the content tree of the Pages application and open the Properties -> URLs tab:

  • Document alias - the unique name of the document in the given section of the website. Aliases form the alias path of each document, which contains all parent documents up to the root of the site’s content tree. The alias path of a document is then used to generate its default URL. For example, if you set a document’s alias to Media, then the URL is: <site domain>/<parent document alias path>/Media.aspx
  • Document URL path - the fields in this section specify an alternate URL for the document, regardless of its position in the website hierarchy. For example, if you select the Standard URL or wildcard Path type and enter /Medialibrary,the URL of the document is: <domain>/Medialibrary.aspx

Adding document aliases

You can add more URLs to documents through document aliases. Aliases do not change how the system generates the main URL of a document, they only make the given document available under other URLs.

To create document aliases:

  1. Open the Pages application.

  2. Select the document in the content tree.

  3. Open the Properties -> URLs tab.

  4. Click Add new alias in the Document aliases section.

  5. You can fill in the following properties for each alias:

    Property

    Description

    Path type

    You can choose several different URL types for the alias path:

    • Standard URL or wildcard - the alias URL is handled by the standard Kentico rewriting engine. Wildcard URLs can be used here, as described in Wildcard URLs.
    • Route - the alias URL is processed as an ASP.NET Route pattern.
    • MVC - requests to the alias URL are handled as requests for an MVC page. See Developing sites using the MVC framework for more information.The selection determines how the system processes the value of the Path or pattern property.

    Path or pattern

    Enter a URL path for the document alias according to the selected Path type.

    For example, if you enter /Mediagallery as the value, you can then access the document under the following URL: <domain>/Mediagallery.aspx

    Default controller
    (MVC only)

    The name of the MVC controller containing the action 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
    (MVC only)

    Specifies the MVC action that the controller performs when the document is accessed through the alias URL.

    Alias redirection

    Determines how the system handles (redirects) the URL when the document is accessed through the alias:

    • Use site settings (default) - with this option, the redirection behavior follows the Redirect document aliases to main URL setting specified for the website in Settings -> URLs and SEO.
    • Redirect to main URL - if selected, the system always redirects the alias URL to the document’s main URL, i.e. the alias path or custom URL path (if specified).
    • Do not redirect - if selected, the system does not redirect the alias URL. This option is recommended if the URL of the alias contains a wildcard.See also: Search engine optimization

    Culture

    Determines which language version of the document the system displays when the page is access through the alias URL.

    URL extensions

    Specifies additional supported extensions for the alias URL. To use custom extensions, you need to configure the system according to the instructions in Custom and extensionless URLs.

    This field is optional.

    Track campaign

    The system assigns visitors who access the document through the alias to the selected web analytics Campaign.

    For example, you can create a special alias for a document and then use the alias URL in links contained in marketing materials, such as banners, e-mails etc. This allows the system to monitor how many page views the website receives as a result of the campaign and track the activity of the visitors who arrive as a result.

    This field is optional.

  6. Click Save.

If you now switch back to the document’s Properties -> URLs tab, the new alias appears in the Document aliases section. You can add any number of aliases.

Viewing all aliases on a website

You can access a list of all aliases defined on the website (for all documents).

  1. Open the Pages application.
  2. Select a document with an alias in the content tree.
  3. Open the Properties -> URLs tab.
  4. Edit () any alias.
  5. Click View all aliases in the page header.

The information provided can help you avoid URL collisions when creating new aliases, and allows you to manage aliases from a single location.

Automatic creation of new document aliases

You can configure the system to automatically create new document aliases when a user sets a new URL path, alias or extension for a document:

  1. Open the Settings application.
  2. Select the URLs and SEO category.
  3. Enable the Remember original URLs when moving documents setting.
  4. Click Save.