In this tutorial, you will learn how to create 301 redirects within Umbraco CMS. In this tutorial, you will learn about two ways to perform re-directs. The Umbraco way and the IIS way. You will learn the differences between the two as well as my recommendation as to which technique you should use and why. If this sounds of value to you, read on 🔥🔥🔥

UrlRewritingNet.URL rewrite

Out-of-the-box, Umbraco ships with a module that will allow you to create re-directs. This is the UrlRewritingNet.UrlRewrite module. To get started creating re-directs with this module you will need to update UrlRewriting.config. You can find this file within your website's webroot here:

ConfigUrlRewriting.config

To create a new redirect, you need to add a redirect rule within this file. An example of a rule is shown below:

The above rule transforms a request from www.website.com/sitemap.xml to www.website.com/xmlsitemap

The Umbraco UrlRewriting module might look like a quick and easy way to set up re-directs within your website, however, there is a catch. Historically, the Umbraco UrlRewriting has been known to have very bad performance issues. If you want to learn more about those issues, I recommend reading this article. Basically, if you only need to create one or two redirects it is fine. If you have a massive amount of traffic and you need to create 10 or 20 rules, it is not fit for purpose. So if we can not use the Umbraco option, let us look at the IIS option 🤔

Url Rewrite

Url Rewrite is probably the most used re-direct tool within ASP.NET applications. Url Rewrite is an IIS extension module that is built by Microsoft. To get started with Url Rewrite, you need to download it from here. After installing this module, you can add rules within IIS. When you do this, your websites web.config files will also be updated with the rule. Creating a rule within IIS is easy enough. Open IIS and navigate to your website instance:

How To Set-up Page Redirects In Umbraco 1

In the top-right, you should see an option called Add Rule(s)..:

How To Set-up Page Redirects In Umbraco 2

When you click on Add Rules, you should see a screen that gives you a lot of options. In most instances, you will just want to create a new inbound blank rule.

How To Set-up Page Redirects In Umbraco 3

To create a rule click on the New Rule link:

How To Set-up Page Redirects In Umbraco 4

To create a new rule, give the rule a name. Like the Umbraco UrlRewrite module, you can define your rules using regular expressions. This means you can get as complex as you want. For the majority of developers who can not remember regex syntax, I'm guessing the chances are at some stage you will more likely feel slightly annoyed as it can take some trial and error to get a redirect working 😕

In the pattern field, add in the Url that should trigger the rule. You do not need to add the website domain. If you wanted this URL to trigger the redirect www.website.com/sitemap.xml you would add the value sitemap.xml within this field.

In the action property, add the Url that you want the request to be re-directed to. In my example, I'm redirecting the request to www.website.com/xmlsitemap. When you are happy with the rule, save it by clicking on the Apply button in the top right. Job done 💥

If you look in your website's web.config you should now be able to see the rule. Check this into source-control before you forget 🤔

Obviously, if you prefer to work directly within your web.config you can. Install the module, copy the section above and change it to meet your needs. Simples 🔥🔥🔥

The one word of caution I will offer around using this module is that the site will not work if your web.config contains rules and the module is not installed on the server. Do not forget, to install the module on all of your environments. Forgetting to do this will mean you will be faced with strange errors when launching your site for the first time on a new server. The errors that you will encounter will be very vague and non-helpful. You can waste hours of your life trying to figure out what's not working. You will feel very silly when you figure out what you've forgotten to do. You have been warned, do not be SILLY 😕


You are now a master of the two methods of creating re-directs within Umbraco. I recommend you use the IIS version. I personally wouldn't recommend using the Umbraco UrlRewrite module. It might come with Umbraco and is easy to use, however, it has performance issues and it is not as widely used or supported as Url Rewrite.

Url Rewrite is used on thousands of servers, can be used in IIS and has good documentation. Url Rewrite is pretty easy to use, install it on all of your servers then either using the GUI or within your web.config, define some rules. Happy Coding 🤘