Skip to content

How to redirect www to non-www (or the other way)

Best practices1 min readFixes check www-redirect

Serving the site on two hostnames splits caches, cookies and ranking signals. Pick one and redirect the other with a 301.

Step by step, with screenshots: Redirects without chains: 301, 302, 307, 308 and one hop →

Check your own site

Runs this check and the other 186, free, in about 45 seconds.

What a passing site looks like

  • www and non-www redirect: passeswarning · −1 ptseffort M

www and non-www redirect

Why it matters. When www and non-www both answer, visitors and tools see two sites with separate cookies, caches and analytics sessions. One should redirect to the other.

How to fix it.
  1. Pick one host and 301-redirect the other to it, keeping the path; most hosts and CDNs have a one-click setting for this.
  2. Use the chosen host everywhere (links, sitemap, analytics property, social profiles).

Filed under Best practices. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.