Cloudflare redirect loops with mismatched TLS settings
I was setting up a page rule in Cloudflare to redirect from one domain to another and ran into an infinite redirect loop that had me scratching my head for a while.
Turns out the issue was mismatched TLS settings between the two domains. The domains had different SSL/TLS encryption modes configured:
- Flexible: Cloudflare to visitor uses HTTPS, Cloudflare to origin uses HTTP
- Full: Cloudflare to visitor uses HTTPS, Cloudflare to origin uses HTTPS (allows self-signed certificates)
- Full (Strict): Same as Full but requires valid SSL certificate on origin
When redirecting between domains with different TLS settings, Cloudflare can become confused about whether the request should use HTTP or HTTPS, causing it to continuously bounce between protocols.
Solution: Ensure both domains use the same SSL/TLS encryption mode in Cloudflare’s SSL/TLS settings before setting up redirect rules. In my case, changing one domain from Flexible to Full (Strict).
You can check and modify TLS settings at: Cloudflare Dashboard → SSL/TLS → Overview → Your SSL/TLS encryption mode.