Skip to content

www and apex both return 200

When both https://domain.com and https://www.domain.com return 200 with the same content, search engines see two distinct origins serving the same pages. Link equity is split between them. Google may index both versions. A canonical tag helps, but it does not fully substitute for a proper redirect.

Choose one version as your primary domain and redirect the other to it with a 301.

The fix depends on your hosting or CDN configuration.

In the Vercel dashboard, set your primary domain under “Domains” in your project settings. Vercel automatically issues a 301 redirect from the non-primary variant. No additional config is needed.

In netlify.toml, redirect the non-canonical variant:

# Redirect www to apex
[[redirects]]
from = "https://www.yourdomain.com/*"
to = "https://yourdomain.com/:splat"
status = 301
force = true
server {
listen 80;
listen 443 ssl;
server_name www.yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC]
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]

In “Rules” > “Redirect Rules”, create a new rule:

  • Match: hostname www.yourdomain.com
  • Action: Dynamic redirect to https://yourdomain.com${uri_path}
  • Status code: 301

Check that the non-canonical version redirects:

Terminal window
curl -I https://www.yourdomain.com/

You should see 301 Moved Permanently with a Location: header pointing to your canonical domain. Re-run orino audit to confirm the check passes.