Troubleshooting guide · technical-seo · Published 2026-08-15 · 4 min read

www vs non-www: pick one and redirect

www vs non-www guide: why the two hosts look duplicated, picking a preferred host, 301 redirecting, and edge cases.

Symptoms

A shortcut for what is happening:

HostBehavior before fixBehavior after fix
https://example.com/pageServes a copy, indexed separately200, the canonical URL
https://www.example.com/pageServes a copy, indexed separately301 to the non-www URL

Why this happens

The leading www is a regular third-level host label, not part of the domain name. www.example.com and example.com are separate hosts that can answer independently. If both respond with the same content, search engines see two copies of every page, which splits signals and can be labelled a duplicate content set. The fix is host choice plus a redirect of one host onto the other. See duplicate content and canonical conflicts.

Choosing a host

There is no SEO winner between www and non-www; search engines treat them as equivalent once one redirects to the other. Pick whichever is easier to maintain.

Decide once, write it down, and make every internal link use the chosen host so the redirect is not the path you rely on everywhere.

How to fix (ordered)

  1. Pick the preferred host, then move all internal site links and the sitemap to that host, so the chosen form is the canonical URL.
  2. Add a 301 from the non-preferred host to the preferred host at the server or CDN layer, covering the whole host, not page by page.
  3. Ensure HTTP and HTTPS both resolve: redirect http:// to https:// on the same host choice, and confirm the https form of the non-preferred host also redirects to the preferred https URL. See HTTP to HTTPS redirect.
  4. Make the redirect authoritative and keep the canonical on the chosen host; the search engine then consolidates properties and link data onto the surviving host, with no legacy preferred-domain setting needed.
  5. Make sure the canonical on every page uses the chosen host, so no page references the retired host. See canonical tags explained.
  6. Verify with a fetch that shows headers: the non-preferred host returns 301, its Location points at the chosen host, and that host returns 200.

Edge cases

Prevention

The redirect mechanics behind a healthy host move are detailed in HTTP 301 redirects that preserve rankings.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services