Change Umbraco page URLs using umbracoUrlAlias

If you are building a new website, or upgrading a current website and you want to design your own URLs, it can be done easily using Umbraco. Using the umbracoUrlAlias property on a page in Umbraco gives you the ability to set up one or more different URLs for a single page.

The page structure of your site might create long URLs, and you may want to use a shorter one, the umbracoUrlAlias will do that for you. Or a page may have previously existed with a different URL, and you want to catch the traffic going to that URL and get them to look at this page, the umbracoUrlAlias will do that for you as well.

How to set it up

  • Create property on in Document Types which applies to all pages you want to change the URL
  • Call the name anything you want e.g Page URL and Possibly give it a new tab.
  • Call the alias umbracoUrlAlias
  • Type as text sting
  • Make it required (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
  • Go into all your pages and rename them using the property you just created
  • Now with your code, say with the navigation where you have used .Url change it to .umbracoUrlAlias and the new URL’s will be used.

umbalias

Now in the content of that page, look for the property you created and enter an alternative URL. Please note that the values you use must be lowercase, not use a leading slash and not use a trailing “.aspx” or trailing slash. If you are adding multiple values, they must be separated with a comma.

umbracoUrlAliasMultiple

In this case the all the URLs will lead to the original page:

Read more:

 

Leave a comment