Website Health Guides

WWW vs Non-WWW Redirects: SEO and Technical Best Practices

Learn how to choose www or non-www, set up clean 301 redirects, avoid duplicate hosts, fix redirect loops and keep SEO signals consistent.

By CheckDomainHealth Editorial Team Reviewed by Dionis Ceban Updated Jun 28, 2026 8 min read Beginner

Introduction

A website can often be reached with both www and non-www versions, such as www.example.com and example.com. Technically, these are different hostnames. If both versions load separately without a clear redirect, users and search engines may see duplicate versions of the same site.

There is no universal SEO rule that says www is always better than non-www, or the reverse. The important part is consistency: choose one canonical host, redirect the other version cleanly, keep HTTPS working, and make sure internal links, canonical tags and sitemaps all use the final version.

Quick answer

Quick answer

Choose either www or non-www as the canonical version, then redirect all other variants to it with a 301 redirect. Test HTTP, HTTPS, www and non-www versions, make sure the final URL returns 200 OK, update canonicals, internal links and sitemap, and avoid redirect chains or loops.

WWW vs non-WWW

WWW and non-WWW are two different hostnames.

  • www.example.com
  • example.com

Both can point to the same website, but they are not technically the same URL. Without redirects, both versions may be accessible separately.

The goal is not to make both versions active. The goal is to choose one final version and redirect the other to it.

Which is better?

For most websites, either version can work well.

WWW

  • traditional website hostname
  • useful for some cookie and DNS separation setups
  • common for larger or older websites

Non-WWW

  • shorter and cleaner
  • common for modern brands
  • easier to type and display

From an SEO perspective, consistency matters more than the choice itself. Pick one version and use it everywhere.

Four URL versions

Every website should test all four common versions:

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

Only one should be the final canonical version.

Example if non-www HTTPS is canonical
http://example.com  301  https://example.com
http://www.example.com  301  https://example.com
https://www.example.com  301  https://example.com
https://example.com  200 OK

The final canonical URL should return 200 OK, not another redirect.

Duplicate hosts

If both www and non-www load the same site without redirects, problems can appear.

  • duplicate content signals
  • split backlinks
  • inconsistent canonical URLs
  • analytics fragmentation
  • cookie/session confusion
  • sitemap mismatch
  • crawl inefficiency
  • redirect confusion after migrations
  • SSL mismatch warnings
  • inconsistent brand URLs

Search engines are usually good at understanding duplicates, but relying on guesswork is worse than using clear redirects.

Redirect strategy

A clean redirect strategy should send every variant directly to the chosen final URL.

Good vs bad redirect path
Good:
http://www.example.com/page
 301 https://example.com/page
 200 OK

Bad:
http://www.example.com/page
 301 http://example.com/page
 301 https://example.com/page
 200 OK

Avoid chains. Each non-canonical version should redirect directly to the final HTTPS canonical version.

Why this matters

Why this matters

WWW/non-WWW consistency matters because users, search engines, backlinks, analytics tools and crawlers should all resolve to the same final website version. Clean redirects reduce duplicate URLs, preserve signals and make troubleshooting simpler.

This is especially important after HTTPS migrations, domain moves, WordPress rebuilds, CDN setup and SEO migrations.

How to check redirects

Use Website Status Checker to test all four URL versions and confirm the final destination.

Check:

  1. Non-www HTTP — Test http://example.com.
  2. WWW HTTP — Test http://www.example.com.
  3. Non-www HTTPS — Test https://example.com.
  4. WWW HTTPS — Test https://www.example.com.
  5. Final status — The canonical version should return 200 OK.
  6. Redirect type — Non-canonical versions should usually use 301 redirects.
  7. Redirect chain — Each version should redirect directly to the final URL.
  8. SSL coverage — The certificate should cover both www and non-www if both HTTPS variants are used or redirected.

Test all four versions

Use Website Status Checker to test all four URL versions and confirm the final destination.

Run Website Status Check →

Common problems

Both versions return 200

Medium

WWW and non-WWW both load the same content without redirecting.

Next step: Choose one canonical host and redirect the other version.

Redirect chain between host versions

Medium

The URL passes through multiple host/protocol redirects.

Next step: Redirect directly to the final HTTPS canonical URL.

Redirect loop

High

WWW and non-WWW rules conflict and redirect back and forth.

Next step: Review server, CDN, CMS and plugin redirect rules.

SSL does not cover one version

High

One HTTPS hostname shows a certificate mismatch before redirecting.

Next step: Install a certificate covering both www and non-www.

Canonical tags use wrong host

Medium

The page redirects to one host but canonical tags point to another.

Next step: Update canonical tags to the final canonical version.

Sitemap uses non-canonical URLs

Medium

The sitemap lists URLs that redirect or use the wrong host.

Next step: Regenerate sitemap with final 200 URLs only.

Internal links use mixed hosts

Low

Some links point to www and others to non-www.

Next step: Update internal links to the chosen canonical host.

CDN and origin rules conflict

High

CDN redirects one way while the origin redirects another.

Next step: Use one consistent host rule across CDN and origin.

WordPress site URL mismatch

Medium

WordPress Address and Site Address do not match the desired canonical host.

Next step: Update WordPress URL settings and clear caches.

How to set it up

  1. Step 1: Choose canonical host

    Decide whether the final site should use www or non-www.

  2. Step 2: Confirm SSL coverage

    Make sure the certificate covers both example.com and www.example.com.

  3. Step 3: Configure one redirect rule

    Redirect the non-canonical host directly to the canonical HTTPS URL.

  4. Step 4: Avoid duplicate layers

    Do not create conflicting redirects in server, CDN, CMS and plugins at the same time.

  5. Step 5: Update site settings

    Update CMS settings, canonical tags, internal links and sitemap.

  6. Step 6: Test all four variants

    Check HTTP/HTTPS and www/non-www versions.

  7. Step 7: Check final status

    Confirm the final URL returns 200 OK.

  8. Step 8: Monitor after launch

    Review crawl errors, analytics, Search Console and redirect logs.

WordPress setup

In WordPress, check:

  • WordPress Address URL
  • Site Address URL
  • permalink settings
  • redirect plugins
  • SEO plugin canonical settings
  • .htaccess or Nginx rules
  • CDN redirect rules
  • cache plugin settings
  • sitemap output
  • internal links

If WordPress uses non-www but the CDN redirects to www, or the reverse, you can create redirect loops.

CDN and hosting

WWW/non-WWW redirects may be configured at different layers.

  • CDN redirect rules
  • hosting control panel
  • Nginx server block
  • Apache .htaccess
  • WordPress plugin
  • application framework
  • load balancer

Choose the cleanest layer to manage redirects. For many sites, CDN-level redirects are simple, but origin rules should not conflict.

WWW/non-WWW redirect examples
Example A: non-www canonical

http://example.com
 301 https://example.com
 200 OK

http://www.example.com
 301 https://example.com
 200 OK

https://www.example.com
 301 https://example.com
 200 OK

https://example.com
 200 OK

Example B: www canonical

http://example.com
 301 https://www.example.com
 200 OK

http://www.example.com
 301 https://www.example.com
 200 OK

https://example.com
 301 https://www.example.com
 200 OK

https://www.example.com
 200 OK

Examples are illustrative. Replace example.com with your real domain and test before applying rules in production.

Server redirect examples
Apache example: redirect www to non-www

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

Apache example: redirect non-www to www

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Nginx example: redirect www to non-www

server {
    listen 80;
    server_name www.example.com;
    return 301 https://example.com$request_uri;
}

Nginx example: redirect non-www to www

server {
    listen 80;
    server_name example.com;
    return 301 https://www.example.com$request_uri;
}

These examples are simplified. Real rules depend on HTTPS server blocks, CDN, hosting panel, existing redirects and application routing.

SEO checklist

After choosing canonical host

Confirm these SEO and technical items before considering the migration complete.

All four URL versions tested

HTTP/HTTPS and www/non-www checked.

Non-canonical hosts use 301

Permanent redirects for the chosen canonical host.

Final canonical version returns 200

The chosen host loads without another redirect.

No redirect loop

Host rules do not cycle between www and non-www.

No long redirect chain

Each variant redirects directly to the final URL.

Canonical tags use final host

SEO canonicals match the chosen version.

Sitemap uses final host

XML sitemap lists only canonical 200 URLs.

Internal links use final host

Menus and content links avoid mixed hosts.

hreflang URLs use final host if applicable

International URLs stay consistent.

Open Graph URLs use final host

Social sharing URLs match the canonical host.

Old backlinks redirect correctly

Inbound links resolve to the final version.

Search Console property is checked

Preferred host behavior is monitored.

Analytics tracks final host consistently

Reporting uses one canonical hostname.

Frequently asked questions

Is www better than non-www for SEO?

No universal winner. Consistency matters more than the choice.

Should both www and non-www load?

No. One should be canonical and the other should redirect.

Should I use 301 or 302?

Use 301 for a permanent www/non-www choice.

Do I need SSL for both versions?

Yes, if users or crawlers may request both HTTPS versions, the certificate should cover both.

Can www/non-www redirects cause loops?

Yes. Loops happen when CDN, server, CMS or plugin rules conflict.

Should sitemap include redirected URLs?

No. Use only final canonical 200 URLs in the sitemap.

Do I need to update internal links?

Yes. Internal links should point directly to the final canonical host.

Use these free tools to verify your configuration after applying changes.

Browse all Website Health guides →

Need help applying this fix?

Send us your domain, report link or issue details. CheckDomainHealth will review the request and route it to the right technical team if hands-on support is needed.

Get Help Run Domain Health Check

Was this guide helpful?

Your feedback helps us improve our guides for everyone.