# 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.

Canonical: https://scaplet.com/errors/cdn/cloudflare-too-many-redirects

Guide Cloudflare Error · CDN and hosting

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudflare-too-many-redirects%20(%22Cloudflare%20too%20many%20redirects%20(ERR_TOO_MANY_REDIRECTS)%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudflare-too-many-redirects%20(%22Cloudflare%20too%20many%20redirects%20(ERR_TOO_MANY_REDIRECTS)%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudflare-too-many-redirects%20(%22Cloudflare%20too%20many%20redirects%20(ERR_TOO_MANY_REDIRECTS)%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudflare-too-many-redirects%20(%22Cloudflare%20too%20many%20redirects%20(ERR_TOO_MANY_REDIRECTS)%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## 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

_01_Which 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](/glossary/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.

_02_How 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.

_03_Your 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]
```

**Pick one place to force HTTPS**Always Use HTTPS at Cloudflare plus a redirect at the origin is two redirectors. Cloudflare says that if only some parts of an application support HTTPS, you should not enable Always Use HTTPS and should use a single redirect rule for the parts that do.

_04_Checklist

## Edge settings and rules that loop

First_2_
**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.

Next_1_
**Redirect rules and Page Rules** can contradict each other across hosts. Cloudflare's fix is to review them together so no rules conflict.

Then_1_
**WordPress**: Cloudflare recommends its WordPress plugin with the Automatic HTTPS rewrites option on, to reduce [redirect loops](/seo-issues/redirect-loops) and [mixed content](/seo-issues/mixed-content-issue) errors.

**Forcing HTTPS does not fix mixed content**Cloudflare notes that forcing HTTPS does not resolve mixed content, because browsers check the protocol of included resources before they request them. Use relative or HTTPS links, or Automatic HTTPS Rewrites.

_05_Explained

## 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](/glossary/google-search-console) reports failed redirections. Fix the loop first, then check [redirect loops](/seo-issues/redirect-loops) and [redirect chains](/seo-issues/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](/errors/cdn/cloudflare-504) and [502 Bad Gateway](/errors/http/502).

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. 01 [Cloudflare SSL/TLS docs: ERR_TOO_MANY_REDIRECTS](https://developers.cloudflare.com/ssl/troubleshooting/too-many-redirects/) developers.cloudflare.com · checked 2026-11-01
2. 02 [Cloudflare SSL/TLS docs: Always Use HTTPS](https://developers.cloudflare.com/ssl/edge-certificates/additional-options/always-use-https/) developers.cloudflare.com · checked 2026-11-01
3. 03 [Cloudflare SSL/TLS docs: Encryption modes](https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/) developers.cloudflare.com · checked 2026-11-01
4. 04 [Cloudflare Fundamentals: HTTP request headers](https://developers.cloudflare.com/fundamentals/reference/http-headers/) developers.cloudflare.com · checked 2026-11-01
5. 05 [Apache httpd: Redirecting and remapping (Forcing HTTPS)](https://httpd.apache.org/docs/2.4/rewrite/remapping.html) httpd.apache.org · checked 2026-11-01
6. 06 [nginx: ngx_http_rewrite_module](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html) nginx.org · checked 2026-11-01
7. 07 [Chromium source: net/url_request/url_request.h (kMaxRedirects)](https://chromium.googlesource.com/chromium/src/+/main/net/url_request/url_request.h) chromium.googlesource.com · checked 2026-11-01
8. 08 [curl: command line manual (--max-redirs)](https://curl.se/docs/manpage.html) curl.se · checked 2026-11-01
9. 09 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-11-01

Questions

## Asked a lot.

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

_01_ Why 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.

_02_ How 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](/ai-crawlers/googlebot) follows up to 10 hops by default.

_03_ Will 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.

_04_ Should 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.

## Keep learning

[All errors](/errors)

[Learn HTTP 301 Moved Permanently HTTP status codes](/errors/http/301) [Related CDN Performance](/glossary/cdn) [Read next Vercel: too many redirects CDN and hosting errors](/errors/cdn/vercel-too-many-redirects) [Do Run a free site audit Free, about two minutes](/site-audit)

More Cloudflare errors
[Cloudflare 504 Gateway Timeout](/errors/cdn/cloudflare-504) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [Cloudflare verify you are human loop](/errors/cdn/cloudflare-verify-you-are-human-loop)

More in CDN and hosting errors
[ALB 504 Gateway Timeout](/errors/cdn/alb-504-gateway-timeout) [API Gateway 403 Forbidden](/errors/cdn/api-gateway-403-forbidden) [API Gateway 504 Gateway Timeout](/errors/cdn/api-gateway-504) [AWS 502 Bad Gateway](/errors/cdn/aws-502-bad-gateway) [AWS Amplify 404 Not Found](/errors/cdn/amplify-404) [AWS EC2: Connection timed out](/errors/cdn/aws-ec2-connection-timed-out) [AWS Lambda 502 Bad Gateway](/errors/cdn/aws-lambda-502) [AWS Lambda timeout](/errors/cdn/lambda-timeout) [Azure Front Door 502](/errors/cdn/azure-front-door-502) [Cloud Run 503 error](/errors/cdn/cloud-run-503) [Cloudflare 504 Gateway Timeout](/errors/cdn/cloudflare-504) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [Cloudflare too many redirects (ERR_TOO_MANY_REDIRECTS)](/errors/cdn/cloudflare-too-many-redirects) [Cloudflare verify you are human loop](/errors/cdn/cloudflare-verify-you-are-human-loop) [CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [CloudFront 404 Not Found](/errors/cdn/cloudfront-404) [CloudFront 503: Service Unavailable](/errors/cdn/cloudfront-503) [Firebase Hosting 404](/errors/cdn/firebase-hosting-404) [GitHub Pages 404 Not Found](/errors/cdn/github-pages-404) [Google Cloud 502 Bad Gateway](/errors/cdn/google-cloud-502) [Heroku 503 Service Unavailable](/errors/cdn/heroku-503) [Heroku H10: App crashed](/errors/cdn/heroku-h10-app-crashed) [Heroku H12: Request timeout](/errors/cdn/heroku-h12-request-timeout) [Heroku H13: Connection closed without response](/errors/cdn/heroku-h13)

Terms on this page
[HTTPS](/glossary/https) [Google Search Console](/glossary/google-search-console)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
