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.
- Visitor or crawlerRequests example.com/pricing or www.example.com/pricing
- Server answers 200 on bothNo redirect between the two hosts
- Two indexed copiesLinks, signals and reports are split
- 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.
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.
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'- 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
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.
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.
Align canonicals, sitemap and internal links
Make rel=canonical, the XML sitemap, hreflang and internal links all use the preferred host over https.
Update ad URLs and integrations
Point ad final URLs, email links and social profiles at the preferred host so they avoid a redirect hop.
Test it
Run the curl checks again and confirm a single 301 hop, with the path and any UTM parameters kept.
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).
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.
Set the primary domain
Go to Settings > Domains and choose the primary domain. Shopify then redirects the other connected domain to it automatically.
Check both are connected
Make sure both the www and bare domain are listed and connected. Redirecting to the primary is enabled by default for connected domains.
Set the default domain
In Project settings > Hosting, add both versions of the domain and mark one as the default. Webflow redirects the other to it with a 301.
Publish
Republish the site so the change takes effect.
Set the primary domain
In Domains, choose the connected domain and set it as primary. Wix redirects the other version to it.
Set the primary domain
Go to Settings > Domains, open your domain settings and use 'Set as primary' on the preferred version. The others redirect to it.
Check the domain connection
In your funnel or website domain settings, connect the preferred host. If the other host still serves content, add a redirect for it in your DNS or domain provider's forwarding settings, as the exact options depend on your set-up.
Apache (.htaccess)
Redirect non-www to www (swap hosts for the reverse): RewriteEngine On, then RewriteCond %{HTTP_HOST} ^example\.com$ [NC], then RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L].
Nginx
Add a separate server block for the non-preferred host with: return 301 https://www.example.com$request_uri; This keeps path and query string.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]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
- 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
- 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.
Day 0
Redirect works; one host serves 200
Week 3
Site moves host or CDN; the redirect rule is not copied across
Week 4
Both hosts return 200; crawlers find duplicates
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.
Related issues
- SEO-054Both http and https versions resolve with 200Fix guide
- SEO-052Google chose a different canonical than declaredFix guide
- SEO-042Missing rel=canonical on indexable pagesFix guide
- SEO-055Trailing slash and non-trailing slash versions both resolveFix guide
- SEO-065Mirror domain or IP address serves the site with 200Fix guide
- SEO-051Canonical chains (A -> B -> C)Fix guide