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 URL | Expected behavior |
|---|---|
http://example.com/page | 301 -> https://example.com/page (1 hop) |
https://example.com/page | 200 (canonical, no redirect) |
http://www.example.com/page | 301 -> https://example.com/page (1 hop) |
https://www.example.com/page | 301 -> 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
- Pick test pages. Select 10-20 representative pages: homepage, landing pages, blog posts, product pages. Cover different URL patterns.
- Generate all four variations. For each page, create the http/https and www/non-www versions. 20 pages = 80 URLs.
- Batch check. Paste all variations into the batch checker and run.
- Check hop counts. Every non-canonical variation should have exactly 1 hop. Two or more means a chain.
- 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.
- 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 URL | Hops | Final URL |
|---|---|---|
http://example.com/page | 1 | https://example.com/page |
https://example.com/page | 0 | https://example.com/page |
http://www.example.com/page | 1 | https://example.com/page |
https://www.example.com/page | 1 | https://example.com/page |
What broken results look like
| Input URL | Hops | Final URL |
|---|---|---|
http://example.com/page | 1 | https://example.com/page |
https://example.com/page | 0 | https://example.com/page |
http://www.example.com/page | 2 | https://example.com/page |
https://www.example.com/page | 2 | https://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
- Apache (.htaccess): Use a single RewriteRule that checks for both HTTP and www conditions and redirects to the canonical in one step.
- Nginx: Use a server block that catches all non-canonical variations and returns a 301 to the canonical domain with HTTPS.
- CDN (Cloudflare, etc.): Use a single redirect rule for both www and non-www. Disable conflicting origin redirects.
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.