Fix the broken HTTPS redirect chain on Apache
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
- Check RewriteRule and Redirect lines in the *:443 virtual host and in .htaccess for rules that send requests back to the same URL; keep one owner for each redirect.
- Make sure the *:443 virtual host lists example.com in ServerName or ServerAlias, run sudo apachectl configtest and reload.
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
- Shorten the redirect chain
- Fix the HTTP 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.