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.

Scenario

At the time I am writing this post, my most popular blog post is the one I wrote about 10 golden rules for becoming a better programmer.

The URL for that page is http://www.codeshare.co.uk/blog/10-golden-rules-for-becoming-a-better-programmer/
Using the umbracoUrlAlias property, I can create a shorter URL for the page like this http://www.codeshare.co.uk/10-golden-rules

It goes to the same page, and the URL stays as the shorter one, in other words, it doesn't do a redirect.

How to set it up

Just create a property on your page document type and call it Umbraco Url Alias. This will give it a property alias of umbracoUrlAlias.

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.

The #1 Writing Tool

So for my 10 golden rules post, the value I put in was:

I also wanted it to work for other variations, so I added them too.

It means that the following URLs all go to the original page.

http://www.codeshare.co.uk/golden-rules 
http://www.codeshare.co.uk/10-golden-rules 
http://www.codeshare.co.uk/goldenrules 
http://www.codeshare.co.uk/10goldenrules

That should be all you need to know to get it working. If you need any help, please leave a comment.

Paul Seal

A .NET Web Developer from Derby (UK) who specialises in building Content Management System (CMS) websites using MVC with Umbraco as a framework. Paul is passionate about web development and programming as a whole. Apart from when he's with his wife and son, if he's not writing code, he's thinking about it or listening to a podcast about it.

Web: codeshare.co.uk

Comments