Why redirects go wrong
A redirect sends visitors and search engines from one address to another. Done well, it is invisible. Done badly, it slows every visit, loses search ranking along the way or never reaches a page at all.
The four problems
- Loops. A redirect that leads back to an address already visited never reaches a page.
- Chains. More than three redirects before the page slow every visit and lose ranking along the way. Over ten, browsers give up.
- www and non-www. When both serve the site, search engines see two copies and the ranking is split between them.
- Canonical. The page's
<link rel="canonical">should point to the same host, not to another domain.
Fix them
- Long chains. Redirect straight to the final URL. A common chain is
http://example.comtohttps://example.comtohttps://www.example.comtohttps://www.example.com/en/. Sendhttp://example.comto the last one in a single hop. - Both www and non-www serve the site. Pick one and redirect the other to it with a
301. - Loops. Often an HTTPS redirect in the application fights with the proxy or CDN. Make the application trust the proxy's
X-Forwarded-Protoheader. - Wrong canonical. Point it to the final address of the page.
Keep it clean
Redirect problems return after a migration, a CDN change or a new rule. The redirects check follows your monitored URL hop by hop once a day. It fails on a loop or more than ten redirects, and warns about a long chain, both www and non-www serving the site, or a canonical on another host.