Errors & Troubleshooting

ERR_TOO_MANY_REDIRECTS: Fixing the Redirect Loop After Enabling SSL or Cloudflare

Updated November 2026 2 views 6 min read
SSL & HTTPS | Updated November 2026

The "ERR_TOO_MANY_REDIRECTS" error (also shown as "redirected you too many times") means your browser got stuck in a loop where one URL keeps redirecting to another and back again. On Ultra Web Hosting accounts this is almost always caused by Cloudflare's SSL mode being set to "Flexible" while your site also forces HTTPS, and it is fixed by changing one Cloudflare setting.

01. The Most Common Cause: Cloudflare Flexible SSL

If your site is behind Cloudflare and you just started seeing ERR_TOO_MANY_REDIRECTS, the SSL mode is the first thing to check. Cloudflare's "Flexible" SSL mode encrypts traffic between the visitor and Cloudflare, but connects to your origin server over unencrypted HTTP on port 80.

The problem is that almost every modern site also forces HTTPS, either through a WordPress setting, a security plugin, or a rule in .htaccess. So the sequence becomes:

  1. Visitor requests https://yoursite.com
  2. Cloudflare connects to your server over HTTP (because the mode is Flexible)
  3. Your server sees an HTTP request and redirects it to HTTPS
  4. Cloudflare serves that redirect, the browser requests HTTPS again, and step 2 repeats forever

The browser gives up after about 20 hops and shows ERR_TOO_MANY_REDIRECTS. Switching Cloudflare to Full (Strict) breaks the loop because Cloudflare then talks to your server over HTTPS, matching what your server expects.

02. Why a Redirect Loop Happens

A redirect loop is any situation where URL A sends the browser to URL B, and URL B sends it straight back to URL A. The browser follows redirects automatically, but it limits how many it will follow before deciding something is broken. Common loop pairs are:

  • HTTP and HTTPS fighting each other (the Cloudflare Flexible case above)
  • www and non-www both redirecting to each other because of two conflicting rules
  • A plugin and an htaccess rule both trying to force HTTPS in slightly different ways
  • WordPress Address and Site Address set to values that disagree about the protocol or hostname

03. Fix 1: Set Cloudflare SSL to Full (Strict)

  1. Log in to Cloudflare and select your domain
  2. Click "SSL/TLS" in the left sidebar
  3. Under "Overview", find the encryption mode
  4. Select "Full (Strict)" (not Flexible, not Full)
  5. Wait 60 seconds, then clear your browser cookies for the site and reload
Warning

Never use "Flexible" SSL mode with a site that forces HTTPS. If you do not have a certificate on the origin at all, Full (Strict) will fail, but every Ultra Web Hosting account gets a free AutoSSL certificate automatically. If AutoSSL has not issued yet, see AutoSSL Not Issuing before switching modes.

For the full recommended Cloudflare configuration on our servers, see the Cloudflare for WordPress and Websites guide.

04. Fix 2: WordPress Address Mismatch

If you are not using Cloudflare, the next most common cause is a mismatch between the two URL settings in WordPress. Both must use the same protocol (https) and the same hostname (www or non-www, pick one).

  1. Log in to WordPress and go to Settings > General
  2. Check "WordPress Address (URL)" and "Site Address (URL)"
  3. Make sure both are identical, for example both https://yoursite.com with no trailing slash
Tip

If the loop locks you out of wp-admin entirely, set both values in wp-config.php instead. Add these two lines near the top, above the "That's all, stop editing" comment:

define('WP_HOME','https://yoursite.com');
define('WP_SITEURL','https://yoursite.com');

These override the database values and let you back in. A security plugin such as Really Simple SSL that also forces HTTPS can double up with an htaccess rule, so if you have one, deactivate it temporarily while you test.

05. Fix 3: Conflicting htaccess Redirect Rules

Open the .htaccess file in your site's document root (public_html) and look for more than one redirect block. A common mistake is having both an HTTP-to-HTTPS rule and an HTTPS-to-HTTP rule, or a www rule that points the wrong way.

A correct, single HTTP-to-HTTPS redirect looks like this:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Important

Behind Cloudflare Flexible SSL, even this correct rule causes the loop, because %{HTTPS} is "off" on every request Cloudflare forwards. If you must keep Flexible mode for some reason, check %{HTTP:X-Forwarded-Proto} instead of %{HTTPS}. Switching to Full (Strict) is the cleaner fix. For the correct redirect patterns, see How Can I Redirect HTTP to HTTPS and Redirecting non-www to www.

06. Fix 4: Clear Cookies and Cache

Once you have changed a setting, the loop can persist in your browser because a stale redirect is cached. Clear it before deciding whether the fix worked:

  • Clear cookies and cached files for the affected site, or test in a private/incognito window
  • If you use Cloudflare, purge the cache from the Cloudflare dashboard (Caching > Configuration > Purge Everything)
  • If you use a WordPress caching plugin, clear its cache too

07. Still Looping? Diagnose It

If the loop continues, trace exactly where it goes. The redirect chain tells you which two URLs are bouncing:

curl -sIL https://yoursite.com | grep -i '^location'

Each Location: line is one hop. If you see the same two URLs alternating (for example http:// then https:// then http:// again), that pair is your loop. Match it to the fixes above:

  • http then https repeating - Cloudflare Flexible SSL, or an htaccess HTTPS rule firing on a request that is already HTTPS at the browser
  • www then non-www repeating - two conflicting canonical rules, keep only one
  • Mixed content warnings too - see How to Fix Mixed Content Warnings

Still Stuck in a Loop?

If you have switched Cloudflare to Full (Strict), cleared cookies, and the loop persists, open a ticket with your domain name and we will trace the redirect chain on the server side for you.

Open a Support Ticket

Frequently Asked Questions

What causes ERR_TOO_MANY_REDIRECTS?

The browser stopped because your site keeps redirecting in a loop that never lands on a final page. The most common causes are a Cloudflare SSL mode of Flexible while your site also forces HTTPS, a WordPress Site URL and Home URL mismatch, or conflicting redirect rules in .htaccess.

How do I fix a redirect loop on WordPress?

Check that the WordPress Address and Site Address in Settings then General both use the same scheme and host, meaning both https and both with or without www. Then remove duplicate HTTPS or www redirect rules from .htaccess, and if you use Cloudflare, set the SSL mode to Full (strict) instead of Flexible.

Why does Cloudflare Flexible SSL cause a redirect loop?

In Flexible mode Cloudflare talks to your origin over plain HTTP, but your site sees that request as insecure and redirects it to HTTPS. Cloudflare then strips it back to HTTP and the loop repeats. Switching to Full (strict), which UWH AutoSSL supports, breaks the loop.

How do I clear a redirect loop to test the fix?

Clear your browser cookies for the site, since a stale cookie can keep the loop alive, or test in a private window. If you use Cloudflare, also purge its cache after changing the SSL mode or redirect rules so the old behavior is not served from cache.

Quick Recap

  1. Behind Cloudflare? Set SSL mode to Full (Strict), never Flexible
  2. WordPress? Make WordPress Address and Site Address identical
  3. Check htaccess for two redirect rules fighting each other
  4. Clear cookies and purge Cloudflare and plugin caches before retesting
  5. Trace the chain with curl -sIL to see exactly which two URLs are bouncing

Fixing redirect loops on Ultra Web Hosting · Last updated November 2026 · Browse all SSL articles

Share: X in Reddit f Email
  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

Error: SoftException in Application(dot)cpp:303 UID of script is small than min_uid

Errors & Troubleshooting | Updated January 2026 The "SoftException in Application.cpp:...

Firefox Secure Connection Failed: SSL Received a Record That Exceeded the Maximum Permissible Length

SSL & HTTPS | Updated January 2026 The "Secure Connection Failed" error in Firefox means...

Cloudflare Error 525 and 526: SSL Handshake Failed

Errors & Troubleshooting | Updated November 2026 Cloudflare Error 525: SSL Handshake...

ModSecurity Blocked a Legitimate Request: How to Get It Whitelisted

Errors & Troubleshooting | Updated July 2026 Every Ultra Web Hosting server runs a web...

Premature end of script headers

Errors & Troubleshooting | Updated January 2026 "Premature end of script headers" is an...



Save 30% on web hosting - Use coupon code Hosting30