Fix the HTTP redirect chain
Why it matters
Requests to http:// never reach a page, so visitors who type the bare domain or follow an old link get an error. One permanent redirect from http to the https address fixes it.
The fix
- Trace the chain with the command below and find where it loops or stops.
- Make the port 80 site answer every request with one 301 redirect to https://example.com and the same path, and remove other http redirects that fight it.
- If the site is behind Cloudflare or another CDN that connects to this server over plain http (Cloudflare Flexible mode), this redirect loops. Switch the CDN to Full (strict) first, or redirect at the CDN instead (Always Use HTTPS).
bash
curl -sIL --max-redirs 10 http://example.com/ | grep -iE '^(HTTP/|location:)' The examples use example.com. Replace it with your own domain.
Related
- Reported by the HTTP to HTTPS redirect check
- Serve the site over HTTPS
- Stop redirecting HTTPS to HTTP
- Redirect HTTP to HTTPS
- Fix the broken HTTPS redirect chain
- Shorten the redirect chain
- Redirect HTTP straight to HTTPS
- Answer HTTP with a redirect to HTTPS
- Redirect www and apex to one host
- Make the www or apex name work over HTTPS
Scan your domain to see whether this applies to you.