GUIDE

WWW vs Non-WWW Redirect Audit

Google treats www.example.com and example.com as two different sites: one should be canonical and the other should 301 to it in a single hop. In practice, www rules chain with HTTPS rules and CDN/origin config to produce 2-hop chains. This guide tests all four URL variations.

Why this matters

If both versions of your site serve content, Google has to guess which is canonical. The result: split link equity, duplicate content filters, and inconsistent search results. The fix is a 301 redirect from the non-canonical version to the canonical one. One rule. But it interacts with HTTPS redirects, CDN settings, and origin configs in ways that create chains.

The four variations

Every URL has four versions. All four should resolve to the same canonical URL:

Input URLExpected behavior
http://example.com/page301 -> https://example.com/page (1 hop)
https://example.com/page200 (canonical, no redirect)
http://www.example.com/page301 -> https://example.com/page (1 hop)
https://www.example.com/page301 -> https://example.com/page (1 hop)

This assumes the canonical is https://example.com (non-www). If yours is https://www.example.com, the logic is the same, just flipped.

Key point: Every non-canonical variation should reach the canonical in exactly one hop. If http://www.example.com first redirects to https://www.example.com, then to https://example.com, that is a 2-hop chain.

Common misconfigurations

Sequential redirect rules

The server has two separate rules: one redirects HTTP to HTTPS, another redirects www to non-www. For http://www.example.com, the result is: http://www -> https://www -> https://non-www. Two hops. Fix: combine into a single rule, or order them so the www redirect fires first.

CDN and server disagree

Your CDN normalizes to non-www. Your origin redirects to www. The request bounces. This is especially common with Cloudflare, where Page Rules handle www differently from the origin's .htaccess or Nginx config.

DNS-level redirect creates a chain

Some DNS providers offer HTTP redirects for the www record. The DNS redirect goes to the non-www HTTP URL, which then redirects to HTTPS. Two hops. The DNS redirect should go directly to the HTTPS canonical URL.

How to audit

  1. Pick test pages. Select 10-20 representative pages: homepage, landing pages, blog posts, product pages. Cover different URL patterns.
  2. Generate all four variations. For each page, create the http/https and www/non-www versions. 20 pages = 80 URLs.
  3. Batch check. Paste all variations into the batch checker and run.
  4. Check hop counts. Every non-canonical variation should have exactly 1 hop. Two or more means a chain.
  5. Verify final URLs match. All four variations of each page should land on the same final URL. If some land on www and others on non-www, canonicalization is broken.
  6. Check status codes. Every redirect should be a 301. 302s are treated as temporary and may not pass full link equity.

What clean results look like

Input URLHopsFinal URL
http://example.com/page1https://example.com/page
https://example.com/page0https://example.com/page
http://www.example.com/page1https://example.com/page
https://www.example.com/page1https://example.com/page

What broken results look like

Input URLHopsFinal URL
http://example.com/page1https://example.com/page
https://example.com/page0https://example.com/page
http://www.example.com/page2https://example.com/page
https://www.example.com/page2https://www.example.com/page

Here, http://www takes 2 hops (www HTTP -> www HTTPS -> non-www HTTPS). And https://www is not redirecting at all, serving content on the www version. That is a duplicate.

How to fix

Pick one and stick with it. Do not set up www redirects on your server and non-www redirects on your CDN. All redirect rules must agree on which version is canonical.

For the related protocol audit, see our HTTP to HTTPS redirect audit.

Audit your www/non-www redirects

Batch check all four variations of your important URLs and inspect each hop.

Sign up free