Black Friday: 50% off the full report and report packs until Tuesday 1 December.

Start a free scan

Fix library

Send www and non-www to one address

If your site opens at both www and non-www without one redirecting to the other, every page has two addresses. One permanent redirect fixes it for the whole site.

  • A developer
  • about 20 min

The fix: Pick one version, www or non-www, and 301-redirect every address on the other to the same path on it.

Step by step

  1. Choose the version to keep: usually the one already shown in Google and used in your links and ads.
  2. Set up a site-wide 301 redirect from the other version that keeps the rest of the address, so example.com/about goes to www.example.com/about, not to the homepage.
  3. Make sure your HTTPS certificate covers both names, so the redirect works without a security warning.
  4. Check that canonical tags, the sitemap and internal links all use the chosen version.
  5. Test a few pages on the other version; each should redirect in one hop.

On your website builder

WordPress
  1. Set both addresses in Settings → General to your chosen version; WordPress then redirects the other version itself, as long as your host sends both names to the same site. If the other version still loads without redirecting, ask your host to add the redirect at server level.
Shopify
  1. In Settings → Domains, set your preferred domain as primary; Shopify redirects the other connected domains to it. Make sure both the www and non-www names are connected.
Wix
  1. Once your domain is connected, Wix redirects between the www and non-www versions itself. If both load, check the domain's connection in your Wix domain settings or with your domain provider.
Squarespace
  1. In your Squarespace domain settings, set the primary domain; the other version then redirects to it.
Webflow
  1. In Site settings → Publishing, set your preferred custom domain as the default; Webflow redirects the other domains to it. Then republish.

Why it matters

When a site opens at both the www and the non-www address and neither redirects to the other, Google sees two addresses for every page, so links and other signals can be split between them, and the version shown in search may not be the one you prefer. A single permanent redirect from one to the other fixes it for every page at once.

For your developer

The problem is a twin host that answers 200 on its own host instead of a 301 to the main host. Add a host-level 301 that preserves path and query, ideally at the edge or CDN, and serve a certificate valid for both names. A rel=canonical alone is only a hint and doesn't stop visitors and links from landing on the duplicate host.

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;
}
Send the bare domain to www, keeping the path (nginx)

Sources