Redirect HTTPS straight to the other host's HTTPS page

headers.redirect.https_downgrade_twin · effort: minutes

Why it matters

The HTTPS homepage of this host redirects visitors to the plain http page of its www or non-www twin, although the twin serves the site over https itself and visitors lose the encrypted connection on the way. Point the redirect at the twin's https address instead.

The fix

  1. Follow the redirect with the command below. The first Location header starts with http:// and names the other form of your host (www.example.com or example.com); that hop is the one to change.
  2. Make the https server of example.com answer with a redirect straight to the https:// address of that other host, keeping the path. Do not send https visitors to http:// first.
  3. Check that https:// of the other host answers with the site and not with another redirect back.
bash
curl -sIL 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.