Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Both www and non-www resolve with 200: how to find and fix it

SEO-053Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A host is the part of a web address before the path. example.com (non-www, also called the apex or bare domain) and www.example.com are technically two different hosts. They can point to the same server, and if nothing tells them apart, both return the page with a 200 OK status.

The correct set-up is that one host serves the page (200) and the other answers with a 301 redirect to the matching URL on the preferred host. Without that redirect, every page on your site exists at two addresses.

How the duplicate arises
  1. Visitor or crawlerRequests example.com/pricing or www.example.com/pricing
  2. Server answers 200 on bothNo redirect between the two hosts
  3. Two indexed copiesLinks, signals and reports are split
  4. Diluted rankings and messy dataWrong host may rank or be tracked

Both hosts answer with 200, so search engines and ad links can land on either copy.

Why it costs you leads or sales

Search engines usually pick one version themselves, but they can pick the wrong one or switch between them. Links pointing at each host are counted separately until Google decides they are the same page. That can weaken the page you want to rank.

It also causes practical problems beyond search. Cookies are set per host, so a visitor who lands on www and later returns on the bare domain may look like a new user, may lose a cart or a logged-in session, and can break attribution in your analytics. Forms and tracking set up for one host may not work on the other.

Link signals split across two hostsExample numbers
Link signals split across two hosts (example)www host (no redirect): 60 backlinks; non-www host (no redirect): 40 backlinks; Preferred host (after 301): 100 backlinks038776040100www host (no redirect)non-www host (no redi…Preferred host (after…backlinks

Example: 100 backlinks to a page, split between hosts when no redirect exists, versus consolidated after a 301.

How to check if your site has it

Request both hosts and look at the status code. A healthy site shows a 301 on one and 200 on the other. Test the home page and at least one inner page, over https.

Check status codes with curlbash
curl -sI https://example.com/ | head -n 5
curl -sI https://www.example.com/ | head -n 5

# Healthy: one returns HTTP/2 301 with a Location header
# pointing to the other host, which returns HTTP/2 200
# Problem: both return HTTP/2 200

curl -sI https://example.com/pricing | grep -i -E 'HTTP|location'
curl -sI https://www.example.com/pricing | grep -i -E 'HTTP|location'
Manual checks
  • Open both hosts in a browser and see whether the address bar changes to one version
  • Run curl -sI on the home page and an inner page for both hosts
  • Check the canonical tag on both versions: it should name the preferred host
  • In Google Search Console, look for pages listed under both hosts in the Pages report
  • Search Google for site:www.example.com and site:example.com to see if both are indexed
  • Check that your sitemap uses only the preferred host

How to fix it

Fix duplicate www and non-www hosts
  1. Choose your preferred host

    Pick www or non-www. Either works. Choose the one already used most in links, ads and the index, and keep it consistent.

  2. Add a site-wide 301 redirect

    Redirect every URL on the other host to the same path on the preferred host, keeping the path and query string. Use the platform steps below.

  3. Align canonicals, sitemap and internal links

    Make rel=canonical, the XML sitemap, hreflang and internal links all use the preferred host over https.

  4. Update ad URLs and integrations

    Point ad final URLs, email links and social profiles at the preferred host so they avoid a redirect hop.

  5. Test it

    Run the curl checks again and confirm a single 301 hop, with the path and any UTM parameters kept.

Set the redirect on your platform
  1. Set both addresses to the same host

    In Settings > General, set WordPress Address and Site Address to the preferred host (for example https://www.example.com).

  2. Redirect at the server

    On Apache hosting, add the .htaccess rule from the Custom code tab above WordPress's own rules. Many hosts also have a 'force www' or domain redirect option in their control panel.

Apache: redirect non-www to wwwhtaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
Nginx: redirect non-www to wwwnginx
server {
    listen 443 ssl;
    server_name example.com;
    # ssl_certificate and ssl_certificate_key for example.com go here
    return 301 https://www.example.com$request_uri;
}
Before and after

Before

  • example.com/pricing returns 200
  • www.example.com/pricing returns 200
  • Links and sessions split across two hosts

After

  • example.com/pricing returns 301 to www
  • www.example.com/pricing returns 200
  • One host for ranking, cookies and reporting

How to confirm it's fixed

Confirmation checks
  • curl -sI on the non-preferred host returns 301 with a Location on the preferred host
  • The redirect keeps the path and query string, for example ?utm_source=test
  • There is only one redirect hop, not a chain
  • The preferred host returns 200 and its canonical points to itself
  • The sitemap lists only preferred-host URLs
  • Search Console shows the preferred host's property collecting impressions over the following weeks

How to prevent it happening again

The redirect often disappears after a migration, a host change, a new CDN or a plugin update that rewrites server rules. Re-test the redirect after any of those. Keep one documented preferred host, and use it in every new campaign link, canonical and sitemap.

How the problem tends to return
  1. Day 0

    Redirect works; one host serves 200

  2. Week 3

    Site moves host or CDN; the redirect rule is not copied across

  3. Week 4

    Both hosts return 200; crawlers find duplicates

  4. Week 8

    Rankings and reports look inconsistent; nobody knows why

How FunnelGuard handles this

FunnelGuard detects this only partly. Its redirect check looks at the start URL of each journey you set up. If that start URL, or the host version it redirects to, behaves unexpectedly, you get an alert with a screenshot and a likely cause.

It does not crawl your whole site or compare the www and non-www version of every page. A site where only inner pages lack the redirect would not be flagged by this check.

To cover the rest by hand, run the curl commands above on the home page and a few key inner pages for both hosts, check the Pages report in Google Search Console, and re-test after every migration or hosting change. A free read-only website audit is also available, and the Free plan covers 1 site and 2 journeys with daily checks and no card.

Questions people ask

Is it bad if both www and non-www versions of my site load?

Yes, it is a duplicate content set-up that splits links, signals and analytics across two hosts. Google may choose one itself, but you should not leave it to chance. Redirect one host to the other with a 301.

Should I use www or non-www?

Either is fine for search. Pick the one your site already uses most in links, ads and the index, then apply it everywhere. Consistency matters more than the choice.

How do I redirect non-www to www?

Add a site-wide 301 redirect from the bare domain to the www host that keeps the path and query string. On Apache use a RewriteRule in .htaccess, on Nginx use return 301 in a server block, and on Shopify, Webflow, Wix or Squarespace set the primary domain.

Is a canonical tag enough instead of a redirect?

A canonical tag is a hint, not a command, and it does nothing for visitors, cookies or ad links. A 301 redirect is the stronger fix. Use both: the redirect and a canonical pointing to the preferred host.

How can I check if www and non-www both return 200?

Run curl -sI on both versions of your URL and read the first line of each response. If both show 200 and neither has a Location header, there is no redirect. You can also open both in a browser and see if the address bar changes.

Does the www redirect affect my Google Ads tracking?

It can if the redirect strips parameters such as gclid or UTMs, or if cookies are set on one host only. Make sure the redirect keeps the full query string and that your ad final URLs use the preferred host.

Will fixing this change my rankings?

It should consolidate signals onto one host, but there is no guaranteed change or timeline. Google needs to recrawl and reprocess the URLs. Keep the redirect permanent and consistent.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: redirects checks the journey's start URL only.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.