Free auditStart free
GuideError · CDN and hosting

Cloudflare too many redirects (ERR_TOO_MANY_REDIRECTS)

Fix ERR_TOO_MANY_REDIRECTS on a Cloudflare site: match the SSL/TLS mode to your origin, remove duplicate HTTPS redirects, and test each hop with curl.

6 min
read
9
sources
Oct 29, 2026
updated
Scaplet Editorial Team
author
In one line

ERR_TOO_MANY_REDIRECTS behind Cloudflare means the browser is stuck in a redirect loop. Cloudflare lists three usual causes: an SSL/TLS encryption mode that conflicts with a redirect at your origin, Edge Certificates settings such as Always Use HTTPS or HSTS, and conflicting redirect rules. Find which layer redirects with curl, then keep only one HTTPS redirect.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
ERR_TOO_MANY_REDIRECTS or "The page isn't redirecting properly"
Browser message
20 (kMaxRedirects)
Chromium redirect cap
50 redirects
curl default cap
up to 10 redirect hops
Googlebot default
01Which setting pairs with which origin redirect

What a Cloudflare redirect loop is

After you add a domain to Cloudflare, visitors can see ERR_TOO_MANY_REDIRECTS or "The page isn’t redirecting properly". Cloudflare describes it as visitors getting stuck in a redirect loop: one layer sends the browser to https://, another sends it back to http://, and neither stops. Chromium gives up after 20 redirects, which its source comment ties to the Fetch spec rule that a request with a redirect count of twenty is a network error.
Cloudflare setting

Encryption mode: Flexible

What your origin does
Redirects every HTTP request to HTTPS
Why it loops
Cloudflare sends unencrypted HTTP to the origin, the origin answers with a redirect to HTTPS, and the visitor comes back through the same path
Documented fix
Remove the HTTPS redirect at the origin, or set the mode to Full or higher (needs a certificate at the origin)
Cloudflare setting

Encryption mode: Full or Full (strict)

What your origin does
Redirects every HTTPS request to HTTP
Why it loops
Cloudflare connects over HTTPS, the origin sends the request back to HTTP
Documented fix
Remove HTTP redirects from the origin
Cloudflare setting

Always Use HTTPS on

What your origin does
Redirects HTTPS to HTTP
Why it loops
Cloudflare redirects http to https, the origin redirects back
Documented fix
Remove the origin redirect or disable Always Use HTTPS
Cloudflare setting

HSTS on

What your origin does
Redirects HTTPS to HTTP, or the mode is Off
Why it loops
Compliant browsers turn http links into https, then the redirect sends them back
Documented fix
Remove the origin redirect and keep the mode at Flexible or higher, or disable HSTS
Cloudflare setting

Redirect rules or Page Rules

What your origin does
Not involved
Why it loops
Two rules send a URL to each other, for example https://a.example.com to http://b.example.com and back
Documented fix
Review all redirect rules and Page Rules for conflicts

The loop always has two redirectors that disagree. One is usually Cloudflare (encryption mode, Always Use HTTPS, HSTS, a redirect rule). The other is usually your origin (a server config, .htaccess, a CMS "force HTTPS" option). Cloudflare also states that it recommends not performing redirects at your origin web server, because that can cause redirect loop errors.

02How it works

Find the layer that redirects, with curl

Run curl against the URL that loops and read only the status line and Location header at each hop. --max-redirs stops curl early; its default is 50 redirects, so cap it low when you only need to see the pattern.
Follow the chain and print each hop
curl -sSIL --max-redirs 6 https://example.com/ \
  | grep -i -E '^(HTTP/|location:)'

# A loop prints the same two Location values again and again, then:
# curl: (47) Maximum (6) redirects followed

Then ask the origin directly, skipping Cloudflare. --resolve pins the hostname to your origin IP for this one request (replace 203.0.113.10 with the real address). If the origin alone returns a redirect to the other scheme, the loop is partly its doing.

Ask the origin directly on both ports
# Plain HTTP, the way Flexible mode reaches the origin
curl -sSI --resolve example.com:80:203.0.113.10 http://example.com/

# HTTPS, the way Full and Full (strict) reach the origin
# (-k skips certificate checks, useful for a self-signed origin test)
curl -sSIk --resolve example.com:443:203.0.113.10 https://example.com/
  1. 01

    Note the pattern

    A 301 or 302 from http:// to https:// and back means a scheme fight. A host change (a. to b.) points at redirect rules or app logic.

  2. 02

    Test the origin on port 80 and 443

    If port 80 answers with a redirect to HTTPS while the Cloudflare mode is Flexible, you have the first row of the table above.

  3. 03

    Read the Cloudflare side

    In the Cloudflare dashboard, open SSL/TLS Overview for the encryption mode, then the Edge Certificates page for Always Use HTTPS and HSTS. Review your redirect rules and Page Rules for pairs that point at each other.

  4. 04

    Change one thing, retest

    Change a single setting or remove a single redirect, then repeat the curl above.

03Your call

Fix the origin side

The cleanest fix when you run Flexible mode is to stop redirecting at the origin. If you keep the redirect, the origin needs to know what the visitor used, not what Cloudflare used to reach it. Cloudflare documents that X-Forwarded-Proto identifies the protocol a visitor used to connect to Cloudflare, and that CF-Visitor carries the same as a JSON scheme.
If this fits

Switch to Full (strict) if

  • Your origin has a valid certificate, from a public CA such as Let's Encrypt or from Cloudflare Origin CA.
  • You want Cloudflare to validate the origin's certificate. Cloudflare strongly recommends Full or Full (strict) to prevent malicious connections to your origin.
  • You can then delete the origin redirect or leave it, because the origin now sees HTTPS.
Or

Stay on Flexible if

  • Your origin cannot serve TLS yet. Cloudflare calls Flexible common for origins that do not support TLS.
  • You remove every HTTPS redirect at the origin and enforce HTTPS only at Cloudflare.
  • You accept that traffic from Cloudflare to the origin is not encrypted, and plan to upgrade.
nginx: a redirect that loops under Flexible mode
# Under Flexible mode nginx always sees plain HTTP from Cloudflare,
# so this redirects every request, forever.
server {
    listen 80;
    server_name example.com;
    return 301 https://$host$request_uri;   # remove, or move HTTPS enforcement to Cloudflare
}
Apache .htaccess: the %{HTTPS} trap and the proxy-aware version
# Loops behind Flexible mode: %{HTTPS} queries mod_ssl on the origin,
# and Apache's docs say it reports off when SSL/TLS ends at an upstream proxy.
RewriteEngine On
RewriteCond "%{HTTPS}" !=on
RewriteRule "^(.*)" "https://%{SERVER_NAME}$1" [R=301,L]

# Proxy-aware version from the Apache docs (trust the header only if the
# proxy always overwrites it):
RewriteEngine On
RewriteCond "%{HTTP:X-Forwarded-Proto}" =http [NC]
RewriteRule "^(.*)" "https://%{SERVER_NAME}$1" [R=301,L]
04Checklist

Edge settings and rules that loop

First2
Always Use HTTPS redirects all http requests to https for all subdomains and hosts. It loops if the origin redirects HTTPS to HTTP. Turn it on from the Edge Certificates page, and note it is hidden when the encryption mode is Off.
HSTS tells compliant browsers to rewrite http links to https. With the mode set to Off, or an origin that redirects to HTTP, it loops. Raise the mode to Flexible or higher, or disable HSTS.
Next1
Redirect rules and Page Rules can contradict each other across hosts. Cloudflare's fix is to review them together so no rules conflict.
Then1
WordPress: Cloudflare recommends its WordPress plugin with the Automatic HTTPS rewrites option on, to reduce redirect loops and mixed content errors.
05Explained

What a redirect loop does to SEO

A loop never reaches a final URL. Google says content from a redirecting URL is ignored and the final target is processed instead, so a loop leaves Google with nothing to process. By default Google's crawlers follow up to 10 redirect hops, and Search Console reports failed redirections. Fix the loop first, then check redirect loops and redirect chains across the site, because a long chain that still resolves wastes hops too.

If Cloudflare is serving your 5xx pages instead of redirects, see Cloudflare 504 and 502 Bad Gateway.

Sources · 9

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • cloudflare.com
  • apache.org
  • nginx.org
  • googlesource.com
  • curl.se
  • google.com
  1. 01Cloudflare SSL/TLS docs: ERR_TOO_MANY_REDIRECTSdevelopers.cloudflare.com · checked 2026-11-01
  2. 02Cloudflare SSL/TLS docs: Always Use HTTPSdevelopers.cloudflare.com · checked 2026-11-01
  3. 03Cloudflare SSL/TLS docs: Encryption modesdevelopers.cloudflare.com · checked 2026-11-01
  4. 04Cloudflare Fundamentals: HTTP request headersdevelopers.cloudflare.com · checked 2026-11-01
  5. 05Apache httpd: Redirecting and remapping (Forcing HTTPS)httpd.apache.org · checked 2026-11-01
  6. 06nginx: ngx_http_rewrite_modulenginx.org · checked 2026-11-01
  7. 07Chromium source: net/url_request/url_request.h (kMaxRedirects)chromium.googlesource.com · checked 2026-11-01
  8. 08curl: command line manual (--max-redirs)curl.se · checked 2026-11-01
  9. 09How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-11-01
Questions

Asked a lot.

4 questions people ask next, answered from the sources on this page.

01Why does Cloudflare Flexible SSL cause a redirect loop?

In Flexible mode Cloudflare connects to your origin over HTTP. If the origin redirects every HTTP request to HTTPS, the visitor is sent back to the same URL and the cycle repeats. Remove the origin redirect or move to Full or higher.

02How many redirects before the browser shows ERR_TOO_MANY_REDIRECTS?

It depends on the client. Chromium's source sets a limit of 20 redirects (kMaxRedirects = 20). curl follows up to 50 by default and Googlebot follows up to 10 hops by default.

03Will clearing cookies fix it?

Cloudflare's guide does not list cookies as a cause. Its documented causes are the encryption mode, Edge Certificates settings and redirect rules, so test those with curl before clearing browser data.

04Should the origin or Cloudflare force HTTPS?

Cloudflare recommends not performing redirects at your origin web server, because that can cause redirect loops. Enforce HTTPS at the Cloudflare edge instead.

Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane