Too Many Redirects (ERR_TOO_MANY_REDIRECTS) After SSL or Cloudflare

Too Many Redirects (ERR_TOO_MANY_REDIRECTS) After SSL or Cloudflare

Tested on 12 October 2026 in a ShoHost sandbox with PHP 8.4: a small origin site with a force-HTTPS rule, behind a stand-in proxy that, like Cloudflare’s Flexible SSL mode, receives HTTPS visitors but connects to the origin over plain HTTP. No Cloudflare account was used.

ERR_TOO_MANY_REDIRECTS (Chrome) or The page isn’t redirecting properly (Firefox) means the site keeps sending the browser to another URL, which sends it back. It often starts right after installing SSL or turning on Cloudflare.

The most common cause: Cloudflare Flexible SSL

Terminal: through a proxy that talks to the origin over plain HTTP, the origin's force-HTTPS rule returns 301 to the same URL again and again until curl stops after 5 redirects
A force-HTTPS rule behind a proxy that uses plain HTTP to the origin loops forever.

In Flexible mode, visitors use HTTPS to Cloudflare, but Cloudflare connects to your server over HTTP. Your server sees an HTTP request, redirects to HTTPS, Cloudflare fetches it over HTTP again, and so on. Our test shows exactly that loop.

Fix

  1. Make sure your server has a valid SSL certificate (cPanel AutoSSL gives one free).
  2. In Cloudflare, go to SSL/TLS → Overview and set the mode to Full (strict).
  3. If you must keep the origin on HTTP for now, make the site trust the X-Forwarded-Proto header instead of forcing HTTPS itself.
Terminal: after the origin trusts the X-Forwarded-Proto https header, the same request returns 200 OK
Once the origin knows the visitor is on HTTPS, the loop stops.

Other causes

Diagram of ERR_TOO_MANY_REDIRECTS causes: Cloudflare Flexible, two HTTPS redirects, www vs non-www, site URL, cookies
The common causes and where to fix each.
  • Cloudflare Flexible: the origin sees HTTP and redirects forever. Use Full (strict), as above.
  • Two HTTPS redirects: cPanel’s Force HTTPS Redirect, an .htaccess rule and a plugin all doing it. Keep one. The usual .htaccess rule is below.
  • www and non-www fighting: one rule sends www to non-www, another sends it back. Pick one version and use it in every setting.
  • Wrong site URL: in WordPress, WordPress Address and Site Address must match the version you redirect to. See WordPress too many redirects.
  • Old cookies or cached redirects: test in a private window, and clear site data for the domain.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

See the loop yourself

Run curl -sIL --max-redirs 5 https://example.in/ | grep -iE '^(HTTP|location)' on your computer. The Location lines show where each redirect goes, which usually points at the rule causing it.

FAQ

Why did the loop start when I turned on Cloudflare?

Most likely the SSL mode is Flexible while your server also forces HTTPS. Set Full (strict).

Can clearing cookies fix it?

Only if the loop comes from old cookies or a cached redirect. Test in a private window to check.

Is it safe to remove the .htaccess redirect?

Yes, if another method (cPanel Force HTTPS or Cloudflare’s Always Use HTTPS) still redirects. Keep one.

Redirect loop still there after changing the SSL mode? If your site is on ShoHost, WhatsApp +91 94880 91432 and we’ll trace the redirects with you.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *