You are here: » Windows Server » Umbraco: Route to

Umbraco: Route to

URL Routing in Umbraco, how to redirect your website hostname in Umbraco from to

By default, Umbraco listens to both and This is not good for your Google ranking and SEO, since this will be seen as duplicate content. Fortunately, it is pretty easy to redirect your website to it’s www variant. Here is how to accomplish this.

URL Routing in Umbraco 7: how Umbraco uses rewrites

Umbraco uses it’s own MVC URLRewrite module. Therefore, you can’t use IIS URLRewrite (web.config) to redirect the website to it’s www address.

Umbraco URLRewrite.config
To redirect your domain to its variant, you have to add a redirect to your Umbraco configuration file ~/Config/UrlRewrite.config. Simply add the following redirect:

<add name="domain_to_www" redirect="Domain" ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite" virtualUrl="*)" redirectMode="Permanent" destinationUrl="$1" />

That’s it… Easy, isn’t it? :-)

Here are 11+ Tips to optimize Umbraco CMS

Update 2018-10-30 about URLRewrite.config: @HotChilliCode mentioned on Twitter: since Umbraco version 7.6, the UrlRewriting dependency is removed and Umbraco no longer ships with it. Now you can use IIS URL Rewrite Module! Read more about the changes in the Version Specific upgrades document: Version 7.6.0

Full IIS Rewrite Rules documentation is available.

Leave a Reply

Your email address will not be published. Required fields are marked *