Skip to content
Issue docs

www and non-www versions not resolved to one

Criticalwww_vs_nonIssue 9

What is this issue?

Websites can typically be accessed with or without the www prefix (e.g., both https://example.com and https://www.example.com). This issue checks whether both hostname variants resolve to a single canonical host through consistent redirects, preventing duplicate content and URL fragmentation.

A passing implementation requires:

  • Both www and non-www versions redirect to the same canonical hostname
  • Consistent redirects for all URLs (not just the homepage)
  • No redirect loops between www and non-www variants
  • Proper HTTP to HTTPS redirects in addition to www canonicalization

Example: When a user visits https://www.example.com, they are automatically redirected to https://example.com (or vice versa), and this redirect is consistent across all pages.

Why it matters

Proper www vs non-www canonicalization is important for SEO because it:

  • Prevents Duplicate Content: Search engines might index both versions separately, splitting ranking signals
  • Consolidates Link Equity: Inbound links to both versions get consolidated to a single canonical URL
  • Improves Crawl Efficiency: Search engines don't waste crawl budget on duplicate hosts
  • Strengthens Rankings: Consolidated signals help improve search rankings for the canonical URL

Without proper canonicalization, search engines may treat www and non-www versions as separate websites, diluting your SEO efforts and potentially causing duplicate content issues.

How to fix it

  1. Choose your canonical hostname: Decide whether you want your canonical URL to include www or not (e.g., https://example.com vs https://www.example.com).

  2. Configure server-side redirects: Set up 301 redirects at your web server or CDN level to redirect the non-canonical version to the canonical version.

  3. Redirect all URLs: Ensure the redirect applies to all pages, not just the homepage (e.g., https://www.example.com/products should redirect to https://example.com/products).

  4. Handle HTTP to HTTPS: Ensure HTTP versions also redirect to the HTTPS canonical version.

  5. Update internal links: Use the canonical hostname consistently in all internal links.

  6. Verify with external tools: Use online redirect checkers to confirm the redirects work correctly for various URL paths.

  7. Monitor regularly: Periodically check that the canonicalization remains consistent and hasn't been accidentally broken by server configuration changes.

Examples

Example 1: Inconsistent WWW vs Non-WWW

Problematic State (Fails): Both versions are accessible without redirecting:

  • https://example.com returns 200 OK
  • https://www.example.com returns 200 OK

Search engines may index both as separate pages.

Corrected State (Passes): Choose one canonical version and redirect the other:

  • https://www.example.com → 301 redirect → https://example.com
  • https://example.com returns 200 OK (canonical)

Example 2: Partial Redirects

Problematic State (Fails): Only the homepage redirects, but inner pages don't:

  • https://www.example.com → https://example.com (redirects)
  • https://www.example.com/products returns 200 OK (no redirect)

Corrected State (Passes): Ensure all pages redirect consistently:

  • https://www.example.com → https://example.com
  • https://www.example.com/products → https://example.com/products
  • https://www.example.com/about → https://example.com/about

Example 3: Redirect Loop

Problematic State (Fails): Circular redirects between www and non-www:

  • https://example.com → https://www.example.com
  • https://www.example.com → https://example.com

Corrected State (Passes): Break the loop by redirecting consistently to one canonical version:

  • https://example.com returns 200 OK (canonical)
  • https://www.example.com → 301 redirect → https://example.com

How PixyScan detects this

PixyScan performs www vs non-www canonicalization checks through the following logical steps:

  1. Hostname Discovery: PixyScan crawls URLs from both the www and non-www versions of your domain to see how they respond.

  2. Redirect Tracking: For each URL variant, PixyScan follows redirects and records the final destination hostname.

  3. Consistency Check: PixyScan verifies that:

    • All www URLs redirect to the same canonical hostname
    • All non-www URLs redirect to the same canonical hostname
    • The canonical hostname is consistent across all pages (not just the homepage)
  4. Loop Detection: PixyScan checks for redirect loops between www and non-www variants.

  5. HTTPS Verification: PixyScan ensures that HTTP versions also redirect to HTTPS.

  6. Issue Identification: PixyScan raises issues when:

    • Both www and non-www versions are accessible without redirecting (CRITICAL)
    • Redirects are inconsistent across different pages (WARNING)
    • Redirect loops are detected (CRITICAL)
    • HTTP doesn't redirect to HTTPS (WARNING)
    • The canonical hostname changes between pages (CRITICAL)

What we store

Storage Level

Page Level — This issue is evaluated for each individual URL that returns a redirect.


Database Table / Prisma Model

RedirectChain


Stored Fields

Field Type Description
originalUrl String The original URL that was requested
finalUrl String The final URL after all redirects
chain Json Array of all redirect hops (URLs and status codes)
chainLength Int Number of redirects in the chain
hasLoop Boolean Whether the redirect chain contains a loop

Detection Dependencies

  • The following data sources are required to evaluate this issue:
  • HTTP Response — The crawler follows redirect responses (301, 302, 303, 307, 308)
  • Redirect Chain — All intermediate URLs and status codes are captured
  • Final URL — The destination URL after all redirects are followed

Further reading