webzod
account

Redirect www and apex to one host

headers.redirect.www_split · effort: minutes

Why it matters

Both names serve the site, so search engines see duplicate pages and logins, cookies and HSTS are split between two hosts. Pick one canonical host and permanently redirect the other to it.

The fix

  1. Choose the canonical host. The examples below keep example.com and redirect www.example.com; swap the two names if you prefer www.
  2. Make the other host answer every request with a 301 redirect to the canonical host, keeping the path and query string.
  3. Update the site's own base URL setting and canonical link tags to the chosen host.
http
GET /some/page HTTP/1.1
Host: www.example.com

HTTP/1.1 301 Moved Permanently
Location: https://example.com/some/page

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.