On this page
What this issue is
A CDN (content delivery network) sits between your visitors and your server. The SSL mode controls how that second leg, CDN to server, is encrypted. In Flexible mode the visitor's connection to the CDN is HTTPS, but the CDN's connection to your server is plain HTTP.
The loop starts when your server, CMS or a plugin sees an HTTP request and answers with a redirect to the HTTPS version. The CDN follows the same route again, over HTTP, and gets the same redirect. The browser gives up with a message like "This page isn't working: redirected you too many times".
- VisitorOpens https://yoursite.com from an ad
- CDN (Flexible)Forwards the request to your server over HTTP
- Origin serverSees HTTP and redirects to HTTPS, again and again
- Landing pageNever loads
- Form or checkoutNever reached
The CDN keeps asking the server over HTTP, and the server keeps redirecting to HTTPS.
Why it costs you leads or sales
A redirect loop shows an error page instead of your site. Every visitor who hits an affected URL leaves, and paid clicks are wasted. Because the loop can be limited to some pages (for example only the checkout or a WordPress admin area, where a plugin forces HTTPS), the homepage may look fine while the pages that earn money are broken.
It often appears right after someone changes a setting: turning on a force-HTTPS plugin, moving to a new host, or switching the CDN on. You may not notice, because your own browser can have a cached good copy.
Example: illustrative numbers showing submissions dropping to zero while the loop is live and recovering after the fix.
How to check if your site has it
- The browser shows ERR_TOO_MANY_REDIRECTS or "redirected you too many times".
- The site works when you pause or bypass the CDN, but fails when it is on.
- In your CDN dashboard, SSL/TLS mode is set to Flexible.
- Your server, host or a plugin forces HTTPS (a redirect rule, Really Simple SSL, an .htaccess rule, or a host setting).
- It started after enabling the CDN, changing hosts or adding an HTTPS redirect.
Test from the command line to see the loop. The -L flag follows redirects, and --max-redirs stops it after a few hops.
curl -sIL --max-redirs 6 https://yoursite.com/ | grep -iE '^(HTTP|location)'If you see the same location: https://yoursite.com/ line repeating, you have a loop. Also try a private window, since a cached redirect or cookie can hide or cause the problem in a normal one.
How to fix it
The proper fix is to make the CDN-to-server leg HTTPS as well. That means your server needs a valid certificate, then you set the CDN to Full (strict). Do not just remove the server's HTTPS redirect and stay on Flexible, as that leaves the CDN-to-server traffic unencrypted.
Install a valid certificate on your origin server
Use your host's free certificate (often Let's Encrypt) or a CDN-issued origin certificate. Check that https://your-origin-address loads without errors.
Change the CDN SSL mode
In Cloudflare, go to SSL/TLS, then Overview, and choose Full (strict). Use Full only if your certificate is self-signed.
Clear the CDN cache
Purge cached redirects, then test in a private window.
Check your site URL and redirect rules
Make sure the site address uses https:// and that you have only one place forcing HTTPS (CMS, plugin, server or CDN rule), not several.
Set both URLs to HTTPS
In Settings, then General, set WordPress Address and Site Address to https://. If locked out, set WP_HOME and WP_SITEURL in wp-config.php.
Use one HTTPS redirect
If a plugin such as Really Simple SSL is active, disable duplicate redirects in .htaccess or your host panel.
Only if you must stay on Flexible
Add the snippet shown below to wp-config.php so WordPress trusts the CDN's forwarded protocol. Moving to Full (strict) is still the better fix.
Check the domain setup
Shopify serves its own certificate. If you proxy the store through Cloudflare, the SSL mode must not be Flexible. Follow Shopify's guidance on Cloudflare, or turn the proxy off (DNS only) for the store records.
Avoid Flexible with a proxy
Webflow hosting serves HTTPS itself. If a CDN proxies your domain, use Full (strict) or turn the proxy off for those records, and keep Webflow's SSL setting enabled in Project settings, then Hosting.
Trust the forwarded protocol only if on Flexible
Redirect to HTTPS only when X-Forwarded-Proto is http, not on every request. Better still, install a certificate and use Full (strict).
Nginx example
Use the nginx snippet below to avoid redirecting requests the CDN already marked as HTTPS.
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}Flexible
- Visitor to CDN: HTTPS
- CDN to server: HTTP
- Server forces HTTPS, so the request loops
- Visitors see ERR_TOO_MANY_REDIRECTS
Full (strict)
- Visitor to CDN: HTTPS
- CDN to server: HTTPS with a valid certificate
- Server sees HTTPS, no extra redirect
- Pages, forms and checkout load
How to confirm it's fixed
Run the curl check again
You should see one 301 at most, then a 200 response.
Test in a private window and on mobile data
This avoids cached redirects and local settings.
Load key pages
Open the homepage, a landing page, the form page and the checkout, with an ad-style URL that includes UTM parameters.
Submit a test form
Confirm the submission completes and the lead arrives.
How to prevent it happening again
- Keep the CDN on Full (strict) and note it in your setup docs.
- Set a reminder to renew the origin certificate, or use auto-renewal.
- Force HTTPS in only one place.
- After any host move, CDN change or plugin install, load your key pages and submit a test form.
- Test the live site on a schedule, not only after changes.
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor opens your pages on a schedule and runs your real journeys, such as lead forms and checkouts. If the page ends in a redirect loop or fails to load, the step fails. The failure is re-checked from a second region, and then one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause.
FunnelGuard sees the symptom (the page not loading), so you still need to check the SSL mode in your CDN to confirm the cause. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans include a 3-day free trial.
Questions people ask
Why does Cloudflare Flexible SSL cause too many redirects?
In Flexible mode Cloudflare contacts your server over HTTP. If your server or a plugin redirects HTTP to HTTPS, Cloudflare receives that redirect, asks again over HTTP and gets the same answer. The browser stops after too many hops and shows ERR_TOO_MANY_REDIRECTS.
How do I fix ERR_TOO_MANY_REDIRECTS on Cloudflare?
Install a valid certificate on your origin server, then set SSL/TLS to Full (strict) in the Cloudflare dashboard. Purge the cache and test in a private window. Also make sure only one thing on your site forces HTTPS.
What is the difference between Flexible, Full and Full (strict) SSL?
Flexible encrypts only visitor to CDN and uses HTTP to your server. Full encrypts both legs but accepts any certificate, including self-signed. Full (strict) encrypts both legs and requires a valid, trusted certificate that matches your domain.
Is it safe to use Flexible SSL?
Flexible leaves the connection between the CDN and your server unencrypted, so data on that leg could be read in transit. It is better to use Full (strict) with a valid origin certificate, especially if you collect form data or payments.
Why does my WordPress site loop after I enabled Cloudflare?
Usually WordPress or an HTTPS plugin sees the CDN's HTTP request and redirects it to HTTPS. Set your site URLs to https and switch Cloudflare to Full (strict). As a temporary workaround you can make WordPress read the X-Forwarded-Proto header.
Why does the site work for me but not for visitors?
Your browser may hold a cached good version or a different cookie state. Test in a private window, from another network, and with curl. A scheduled test from outside your network also shows what real visitors get.
Can switching to Full (strict) break my site?
Yes, if the origin certificate is expired, self-signed or issued for another hostname. You may then see 526 errors. Check the certificate on your server before you change the mode.
Related issues
- OPS-113CDN origin errors (520-526 Cloudflare errors)Fix guide
- OPS-107CDN serving stale page after deployFix guide
- OPS-100Cloudflare/WAF blocks real visitors (challenge loops)Fix guide
- OPS-115CDN purges failing / edge outageFix guide
- OPS-101Bot Fight Mode blocking checkout or form postsFix guide
- OPS-102Country/geo block hitting target marketFix guide