webzod
account

Fix the broken HTTPS redirect chain

headers.redirect.broken · effort: about an hour

Why it matters

Requests to the HTTPS site loop, bounce through too many redirects or get no answer, so visitors see an error instead of the site. This usually comes from two layers redirecting against each other, or from a server that accepts TLS but has no site set up for this name.

The fix

  1. Trace the chain with the command below. A loop shows the same Location values repeating (http and https, www and apex, with and without a trailing slash).
  2. Find which layers issue the redirects (CDN, web server, application, a plugin) and let exactly one of them own each redirect.
  3. If the TLS handshake completes but no page comes back, the server has no HTTPS site for this host name, or the application behind it is down. Check the web server's error log and its configuration for this name.
bash
curl -sIL --max-redirs 10 https://example.com/ | grep -iE '^(HTTP/|location:)'

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.