URLs: www vs non-www

By Richard Jennis 18th April 2022
Graphic of man holding a URL on a sign
Domains are powerful things, but have you ever noticed that some website domain names start with www, and some don’t, and some websites you can visit using either!

What’s going on there?

The decision is entirely yours as to whether or not to use www, non-www or both, but whatever you choose stick with it! This will make you appear consistent to both the search engines and your visitors. 

In tech-speak, your chosen domain is called your canonical domain.

Through a couple of different techniques, your web developer should ensure traffic to both variants arrives at your website. Please ensure you check this, it alarms me how often I come across a website where this isn’t the case! 

Option one, use 301 redirects

Your web team should set up your hosting server to accept requests from both www and non-www.

When a request is received to the non-canonical domain, it will be forwarded to the canonical domain. 

How does this work?

  1. Your website server receives a request for http://www.example.com/blog
  2. Your canonical domain is example.com 
  3. The server responds to the user's browser with a 301 redirect with the correct location of http://example.com/blog
  4. The user's browser sends an updated request to the canonical domain http://example.com/blog

This task is completed so quickly the user will be unaware of what has happened unless they notice that www has been dropped from the address bar.

301 redirects also serve as a method to tell Search Engines what the canonical domain is so they update their index listing of your website. This is good SEO.

Option two, set the canonical within your website code

Your web developer can add a line of code within your website code that tells the visitor's browser and search engines what the canonical domain is. 

If your canonical domain is http://www.example.com/blog the line of code will be:

The drawback with this method for this purpose is that the users will still arrive at the non-canonical website, but search engines will understand that the two sites are the same and only index your canonical domain.

The main purpose of this approach is to group a series of pages that cover the same topic and tell search engines so the different pages don’t compete with each other in their ranking index.

What does SimpleClick recommend?

Option one, without a doubt. Option two allows you to effectively have two versions of your website and that isn’t a great User Experience.

As a site owner, ask the question and check that your website loads no matter if www is used or not.

Talk to us today

Find out more about how you can improve the accessibility of your online website content.

Call us on 01473 655669 or email [email protected].