WWW vs Non-WWW

WWW vs non-WWW refers to the choice between serving a website at www.example.co.uk or at example.co.uk. Neither version ranks better, but search engines treat them as separate hostnames, so a site should pick one and redirect the other to it.

What the difference is

The www part is technically a subdomain. In the early web it signalled that a hostname served web pages rather than email or file transfer. Today it is a naming choice. The version without it is often called the bare, root or apex domain.

Because they are different hostnames, www.example.co.uk/page and example.co.uk/page are two different URLs. If both load the same content, you have duplicate content and split signals.

Does either version help SEO?

No. Google does not prefer one over the other. What matters is consistency. Problems only appear when both versions are live, when internal links mix them, or when backlinks point to the version that is not used.

There are some practical, non-ranking differences:

  • DNS flexibility: a www hostname can use a CNAME record, which some hosting and CDN setups prefer. Many DNS providers now offer workarounds for the bare domain.
  • Cookie scope: cookies set on the bare domain can be sent to every subdomain, which some larger sites want to avoid.
  • Brand look: the bare domain is shorter and many brands prefer it in print.

How to set it up correctly

  1. Choose your preferred version and stick with it.
  2. Add a server-wide 301 redirect from the other version, page to page, not everything to the homepage.
  3. Combine this with your HTTPS redirect so that http and https, www and non-www all reach the final URL in one hop.
  4. Make sure every canonical tag uses the preferred version.
  5. Update internal links, your XML sitemap and hreflang tags to the same hostname.
  6. Verify a Domain property in Google Search Console, which covers both versions and all protocols.

Older versions of Search Console had a preferred domain setting. It has been removed, so redirects and canonicals now do this job.

How to check your current setup

Type all four combinations into a browser: http and https, with and without www. Every one should end on the same final URL. A browser extension or an online header checker will show each hop and its status code, so you can confirm the redirect is a single 301 rather than a 302 or a chain.

Then run a crawler across the site and look for internal links that use the wrong hostname. In Search Console, the URL Inspection tool shows which version Google has chosen as canonical for a page. If Google is selecting the version you redirect away from, something in your signals is inconsistent, often old internal links, a stale sitemap or a mismatched canonical.

Common mistakes

  • Leaving both versions returning a 200 status code.
  • Creating redirect chains, for example http to https, then non-www to www, then a trailing slash fix.
  • Forgetting that SSL certificates must cover both hostnames, or the redirect fails with a browser warning.
  • Switching versions on a whim. A change is a small website migration and should be planned like one.

Key Takeaways

  • The www and non-www versions of a site are separate hostnames.
  • Neither version ranks better than the other.
  • Pick one version and 301 redirect the other to it, page to page.
  • Keep canonicals, internal links and sitemaps on the chosen version.
  • Avoid redirect chains when combining HTTPS and hostname redirects.

Related Terms

Want help putting this into practice? Get a free SEO check, or keep learning in the SEO Encyclopedia.