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 www.website .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 www.website.com/news and website.com/news 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.

<rewrite>
<rules>
<rule name="Redirect Non WWW" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(.*)$" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://www.{C:1}/{R:0}" />
</rule>
</rules>
</rewrite>

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.

Conclusion

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

More Posts

1 reply

Trackbacks & Pingbacks

  1. […] handle the WWW or non-WWW Url debate. More information about this can be found in this article, Setting Up Umbraco To Always Use WWW Links. If you use a WWW approach you will change your WWW rule to ignore the […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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