Issue #10 · critical
Issue 10
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
wwwandnon-wwwversions 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 does it matter?
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
-
Choose your canonical hostname: Decide whether you want your canonical URL to include
wwwor not (e.g.,https://example.comvshttps://www.example.com). -
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.
-
Redirect all URLs: Ensure the redirect applies to all pages, not just the homepage (e.g.,
https://www.example.com/productsshould redirect tohttps://example.com/products). -
Handle HTTP to HTTPS: Ensure HTTP versions also redirect to the HTTPS canonical version.
-
Update internal links: Use the canonical hostname consistently in all internal links.
-
Verify with external tools: Use online redirect checkers to confirm the redirects work correctly for various URL paths.
-
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.comreturns 200 OKhttps://www.example.comreturns 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.comhttps://example.comreturns 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/productsreturns 200 OK (no redirect)
Corrected State (Passes): Ensure all pages redirect consistently:
https://www.example.com→https://example.comhttps://www.example.com/products→https://example.com/productshttps://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.comhttps://www.example.com→https://example.com
Corrected State (Passes): Break the loop by redirecting consistently to one canonical version:
https://example.comreturns 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:
-
Hostname Discovery: PixyScan crawls URLs from both the
wwwandnon-wwwversions of your domain to see how they respond. -
Redirect Tracking: For each URL variant, PixyScan follows redirects and records the final destination hostname.
-
Consistency Check: PixyScan verifies that:
- All
wwwURLs redirect to the same canonical hostname - All
non-wwwURLs redirect to the same canonical hostname - The canonical hostname is consistent across all pages (not just the homepage)
- All
-
Loop Detection: PixyScan checks for redirect loops between www and non-www variants.
-
HTTPS Verification: PixyScan ensures that HTTP versions also redirect to HTTPS.
-
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)