Setting Up Umbraco To Always Use WWW Links

Over the years, I've been asked frequently by clients, "what is the difference between www vs non-www in terms of Umbraco site URLs?" Most people get confused about which one is 'better' and what strategy they should pick for Umbraco and SEO. In today's post, I'm going to give a brief overview of the issue to help you understand the difference between www vs non-www and which one is better for Umbraco SEO.

What Is The Difference Between WWW and non-WWW URLs?

In case you are new to this debate, the issue is centred around how should you render links on your website. For example, should your links be .com, just website .com, or a mix of both? In terms of SEO, technical wizardry or anything else you can think of, the difference between www vs non-www is pretty irrelevant. The choice between one or the other is a personal preference and even Google has said that it all depends on your preference. The main thing is you pick one and stick to it. You need to stay consistent with your Url strategy from launch. Why is this important?  Well, if Google finds two URLs and it will treat the two URLs as different pages and penalize your website in terms of ranking which is sub-optimal. So as long as you pick an approach and redirect when the other is used, life is simple :)

Technical Difference between WWW vs non-WWW

When picking an approach I tend to favour using a WWW approach as you get some minor technical benefits compared to using a naked domain (non-www). Using a www allows more flexibility when restricting, cookies when using multiple subdomains, more flexibility with DNS (here, WWW means a website service, when you use a naked domain you don't necessarily know which service you might be working with. Non-WWW domains/naked domains as far as I'm aware don't not have any technical advantages. When I make an architectural choice it's usually based in terms of technical benefits, so I tend to stick with WWW unless someone tells me differently.

How To Force www in Umbraco

If you agree with me then I'm going to quickly show how you can enforce WWW Url's within a few minutes using Url Rewrite. If you want a more detailed guide on how to set-up Url Rewrites in Umbraco then I suggest you read, How To Set-up Page Redirects In Umbraco.
        <rule name="Redirect Non WWW" stopProcessing="true">
          <match url=".*" />
            <add input="{HTTP_HOST}" pattern="^(?!www)(.*)$" />
          <action type="Redirect" redirectType="Permanent" url="http://www.{C:1}/{R:0}" />
As long as you have Url Rewrite enabled on each server, then if you add this rule to your section, your website will ensure all URLs on your website use www.


In today's post, we've covered the still raging debate whether to go www or not. My opinion (for what it's worth) is that it doesn’t matter which one you use; pick one and stick with it. My preference is using www as it provides some slight technical benefits but if I had to use non-WWW I wouldn't loose any sleep over it. The important thing is that your website should load regardless of WWW or non-WWW and redirect when necessary. If your URls don't work then you have bigger issues to worry about. After you make your mind up you can simply use Url Redirect to perform the re-direct. Umbraco does ship with a redirect mechanism but from my research and experience this can cause performance issues, so it's best to stick with tried and tested Microsoft software.

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

Back to top
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-35662136-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + ''; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();