Serving identical content at both www.yourdomain.com and yourdomain.com splits link equity between two URLs, creating duplicate content that Google may rank separately or penalize. Social shares, backlinks, and analytics fragment across hostnames, distorting traffic attribution. Users bookmarking the wrong variant land on an inconsistent canonical, and session cookies scoped to one host break authentication on the other.
Medium because SEO and analytics damage compounds silently over time but does not break functionality or expose data.
Pick one canonical hostname and issue a 301 from the other. In next.config.js, add a redirects() entry with a host match on www.yourdomain.com targeting the root domain with permanent: true. Alternatively, configure the redirect at the hosting layer via vercel.json or Netlify's domain settings — whichever lives closer to DNS.
// next.config.js
async redirects() {
return [{ source: '/:path*', has: [{ type: 'host', value: 'www.yourdomain.com' }], destination: 'https://yourdomain.com/:path*', permanent: true }]
}
ID: pre-launch.infrastructure.www-redirect
Severity: medium
What to look for: Count all redirect rules in deployment config. Enumerate whether www-to-non-www (or vice versa) redirect is configured as a 301 permanent redirect. Check framework config for redirect rules. In Next.js, look for redirects in next.config.* that handles www-to-root or root-to-www canonicalization. Check vercel.json for redirect rules. Check netlify.toml for redirect rules. Check middleware for hostname-based redirects.
Pass criteria: Either a redirect from www to non-www or non-www to www is configured (consistently — one direction), OR the hosting platform handles this automatically at the domain configuration level. Exactly 1 canonical domain form must be chosen with at least 1 permanent 301 redirect from the non-canonical form.
Fail criteria: No redirect configuration found and both www and non-www versions of the domain would serve the site independently without canonicalization.
Skip (N/A) when: Project uses a platform subdomain only (e.g., yourapp.vercel.app) with no custom domain configured.
Cross-reference: For DNS configuration, see dns-configured.
Detail on fail: "No www/non-www redirect configured — both versions of the domain may serve content independently, creating duplicate content and split link equity"
Remediation: Serving the same content at both www.yoursite.com and yoursite.com dilutes SEO link equity and creates a confusing user experience. Pick one canonical form and redirect the other:
// vercel.json — www redirect
{ "redirects": [{ "source": "https://www.yourdomain.com/(.*)", "destination": "https://yourdomain.com/$1", "permanent": true }] }
// next.config.js
async redirects() {
return [
{
source: '/:path*',
has: [{ type: 'host', value: 'www.yourdomain.com' }],
destination: 'https://yourdomain.com/:path*',
permanent: true,
},
]
}
Alternatively, configure this at the DNS/hosting platform level — Vercel and Netlify both offer www redirect toggles in their domain settings dashboard.
For a deeper analysis of SEO redirect configuration, the SEO Fundamentals Audit covers canonical URLs and redirect patterns.