SEO

www vs Non-www

Also called www vs non-www, preferred domain

The choice between running a site at www.example.co.uk or example.co.uk. Either works, provided one redirects to the other.

Quick facts: www vs Non-www

Category
SEO
Also called
www vs non-www, preferred domain
Level
Beginner
Affects
Duplicate content, which URLs Google indexes, link signals, analytics accuracy
Where to see it
Browser, redirect checker, Screaming Frog or another crawler, Google Search Console Domain property
In this article4
  1. How www and non-www work
  2. Why it matters
  3. Common mistakes
  4. How to act on it

“www vs non-www” is the choice between running a website at www.example.co.uk or at plain example.co.uk. Either is fine for SEO. What matters is choosing one, sending every visitor and search engine to it, and never letting both versions serve the same pages.

How www and non-www work

Technically, “www” is a subdomain, just like shop.example.co.uk. The version without it is called the root or apex domain. Because they are separate hostnames, a server can show the same site on both, and to a search engine that looks like two copies of every page.

Add HTTP and HTTPS to the mix and most sites can be reached at four addresses:

  • http://example.co.uk
  • http://www.example.co.uk
  • https://example.co.uk
  • https://www.example.co.uk

Only one should load. The other three should each send a single 301 redirect straight to the same page on the chosen version. Every other signal should agree with that choice: the canonical tag on each page, internal links, the XML sitemap and the website address on your Google Business Profile.

There are a couple of technical differences. In the DNS, a www subdomain can point at a host or content delivery network with a simple CNAME record, while the apex domain traditionally cannot, which is why some hosts recommend www. A cookie scoped to the bare domain is also sent to every subdomain, which matters on larger sites that run separate apps on their own subdomains. For a typical small business site, neither difference decides anything.

Why it matters

When both versions load, links, shares and crawling are split between two copies of the same site. Google usually works out which to index, but it may pick a different one from the one you wanted, report pages as duplicates in Search Console and take longer to combine signals. Analytics can suffer too, with sessions starting on one hostname and ending on the other.

The bigger risk is drift after a change. A new website, a hosting move or a certificate renewal can quietly flip the preference or bring the second version back, and nobody notices until the indexing report fills with duplicates.

Common mistakes

  • Both versions returning a 200 status with no redirect between them.
  • Redirect chains, such as HTTP to HTTPS and then to www, instead of one hop to the final address.
  • Sending every page to the home page rather than to the matching page on the chosen version.
  • Canonical tags pointing at the other version from the one the redirects lead to.
  • Internal links and the sitemap mixing both forms, often after content is copied across from an old site.
  • Switching for no reason. Changing an established site from www to non-www, or back, is a small migration with nothing to gain.

How to act on it

Check what you have. Type all four variants of your address into a browser, or run them through a redirect checker, and confirm three of them reach the fourth in one step. Add a page path to the test, such as /contact/, to make sure inner pages redirect to their own equivalent and not to the home page.

Then check the other signals. View the source of a few pages to confirm the canonical tag uses the chosen hostname, make sure the sitemap does too, and fix internal links that do not. In Search Console, a Domain property covers every version at once, which makes stray traffic on the wrong one easier to spot. Search Console no longer offers a preferred domain setting, so redirects and canonicals are how you tell Google.

For a new site, pick whichever version you like and stick with it. For an established site, keep what you have and make it consistent. Checking these rules is one of the first steps in any technical SEO audit I carry out.

Do and do not

Do

  • Choose one hostname and 301 every other variant to it
  • Keep canonicals, sitemap and internal links on the chosen version
  • Retest after any hosting, theme or certificate change

Do not

  • Let both www and non-www load
  • Chain HTTP, HTTPS and www redirects
  • Switch an established site's version for no reason

Questions people ask about this

Is www or non-www better for SEO?

Neither. Google treats them equally and rankings do not change because of the choice. What matters is picking one and redirecting the other to it consistently, page by page.

How do I redirect non-www to www?

It is set at server or hosting level: in an .htaccess file on Apache, in the server configuration on Nginx, or in your host's or CDN's redirect settings. On WordPress, also make sure the site address in the general settings matches. Whichever method you use, it should be a 301 that keeps the page path.

Can I still set a preferred domain in Search Console?

No. Google removed that setting when it retired the old version of Search Console. You now show your preference through redirects, canonical tags, the sitemap and consistent internal links, and Google follows those.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.