Skip to main content
Ahosting Logo
  • Hosting
    • WordPress Hosting
      Fast, secure hosting for WordPress sites
    • Web Hosting
      Reliable, affordable hosting for sites
    • FFMpeg Hosting
      Fast hosting for FFmpeg projects
    • Reseller Hosting
      Start hosting biz with white-label plans
    • VPS Hosting
      Scalable VPS with full control & power
    • Dedicated Server
      High-power servers for max security
    • WooCommerce Hosting
      Fast hosting for WooCommerce shops
  • Domain
    • Register a Domain
      Secure your domain name in minutes
    • Domain Transfer
      Move domains to Ahosting with ease
    • Premium SSL Certificate
      Enterprise SSL to build customer trust
  • Support
    • Submit A Ticket
      Expert 24/7 help from our support team
    • Abuse Report
      Report abuse to keep network safe
    • Knowledge Base
      Quick answers via step-by-step guides
  • Company
    • Blog
      Expert articles to power your online growth
    • Compare Hosts
      Side-by-side comparison
    • Datacenter
      Secure, high tech datacenter for hosting
    • About Us
      Learn about our mission, values & team
    • Contact Us
      Contact sales for plans, pricing & advice
    • Sitemap
      Find info fast with our clear site map
My Account
Ahosting Logo
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • FFMpeg Hosting
    • Reseller Hosting
    • VPS Hosting
    • Dedicated Server
    • WooCommerce Hosting
  • Domain
    • Register a Domain
    • Domain Transfer
    • Premium SSL Certificate
  • Support
    • Knowledge Base
    • Abuse Report
    • Submit A Ticket
  • Company
    • About Us
    • Contact Us
    • Blog
    • Sitemap
    • Datacenter
  • Legal
    • Privacy Policy
    • Terms of Service
    • Acceptable Use Policy
    • Service Level Agreement
    • Resource Abuse Policy
My Account

AHosting Blog

ERR_TOO_MANY_REDIRECTS in WordPress: Find the Looping Rule With curl

Hosting card on ERR_TOO_MANY_REDIRECTS: four loop signatures, what repeats in the redirect chain, and the likely cause of each.

Matt Chrust

Director of Business Development, AHosting Matt has led business development at AHosting since the company’s founding in 2002. He writes about WordPress hosting infrastructure, server performance, and the evolving requirements of WordPress sites at scale.

Last Updated

October 20, 2026
Home » WordPress » ERR_TOO_MANY_REDIRECTS in WordPress: Find the Looping Rule With curl
  • What ERR_TOO_MANY_REDIRECTS Means in WordPress
    • Why the ERR_TOO_MANY_REDIRECTS Loop Is Rarely a WordPress Bug
  • Read the ERR_TOO_MANY_REDIRECTS Chain With curl Before You Change Anything
    • The Redirect Loop Signature Table for ERR_TOO_MANY_REDIRECTS
  • Cause 1: A Force-HTTPS Rule Behind a Proxy Causes ERR_TOO_MANY_REDIRECTS
    • How WordPress Decides a Request Is HTTPS
    • The wp-config.php Fix for This ERR_TOO_MANY_REDIRECTS Loop
    • The Second Way Out of This ERR_TOO_MANY_REDIRECTS Loop
  • Cause 2: FORCE_SSL_ADMIN Produces an ERR_TOO_MANY_REDIRECTS Loop on wp-admin Only
  • Cause 3: A www and Non-www Fight Creates an ERR_TOO_MANY_REDIRECTS Loop
    • Why the Scheme Alone Rarely Triggers This One
  • Cause 4: Two HTTPS Rules Cause the Last ERR_TOO_MANY_REDIRECTS Pattern
  • What Our ERR_TOO_MANY_REDIRECTS Lab Measured
  • A Five-Step ERR_TOO_MANY_REDIRECTS Fix Order That Avoids Guessing
  • What to Record Before You Ask for Help With ERR_TOO_MANY_REDIRECTS
  • When ERR_TOO_MANY_REDIRECTS Points at Something You Cannot Edit
  • Frequently Asked Questions: ERR_TOO_MANY_REDIRECTS in WordPress
    • How do I fix ERR_TOO_MANY_REDIRECTS on a WordPress site?
    • Why does ERR_TOO_MANY_REDIRECTS appear only on wp-admin and the login page in 2026?
    • Does a 301 vs 302 status matter when debugging an ERR_TOO_MANY_REDIRECTS loop?
    • Should an .htaccess rule vs the WordPress address setting force HTTPS in 2026 without an ERR_TOO_MANY_REDIRECTS loop?
    • Will moving to AHosting stop an ERR_TOO_MANY_REDIRECTS loop that started on my old host?
    • What should I send AHosting support for an ERR_TOO_MANY_REDIRECTS loop in 2026?
    • Can page caching on AHosting hide or cause an ERR_TOO_MANY_REDIRECTS loop in wp-admin?
    • How many redirects does a browser follow before showing ERR_TOO_MANY_REDIRECTS?
    • Why does ERR_TOO_MANY_REDIRECTS appear after I set www as the preferred domain?
    • Can HSTS keep an ERR_TOO_MANY_REDIRECTS loop alive after I fix the server in 2026?
TL;DR

ERR_TOO_MANY_REDIRECTS means two layers keep sending the browser to each other. Run curl -sIL once, read the Location headers, and the repeating pair names the layer to fix.

isten: an ERR_TOO_MANY_REDIRECTS loop is two rules disagreeing, and the redirect chain shows which two. By Matt Chrust, Director of Business Development, AHosting.

What ERR_TOO_MANY_REDIRECTS Means in WordPress

ERR_TOO_MANY_REDIRECTS is the browser telling you that a request was redirected, and the redirect was redirected, and so on until it gave up. The message is not a WordPress error. WordPress is one of the two parties in the argument, and finding the other party is the whole job.

The give-up point is a published number. The Fetch standard says that when a request’s redirect count reaches 20 the browser returns a network error (Fetch standard, HTTP-redirect fetch), and Chromium sets its own limit to 20 (Chromium url_request.h).

Why the ERR_TOO_MANY_REDIRECTS Loop Is Rarely a WordPress Bug

A loop needs two rules that each think they are right. One says the canonical address is HTTPS, the other cannot tell that the visitor already arrived over HTTPS. Or one says www, and another says non-www. WordPress ships with parts of both rules, which is why the loop looks like a WordPress problem, but the second rule is almost always something you or a layer in front of the site added.

Read the ERR_TOO_MANY_REDIRECTS Chain With curl Before You Change Anything

Do not start by disabling plugins. Start by looking at the chain, because the chain tells you which of four causes you have. In a terminal, run curl -sIL --max-redirs 5 https://example.com/wp-admin/, replacing the address with the failing one. The -I flag asks for headers only, -L follows redirects, and --max-redirs 5 stops the output after five hops so you can read it.

curl keeps no cache, so it shows what the server sends today, not what your browser remembers from an hour ago. Read only the Location lines. A loop is any URL that shows up twice.

The Redirect Loop Signature Table for ERR_TOO_MANY_REDIRECTS

We reproduced the first three loops below in a lab and recorded the Location pattern each one prints. The fourth row is the pattern expected when two rules point opposite ways, and we did not reproduce it. Match your curl output to a row, then jump to the section named in the last column.

What repeats in the Location linesWhere the loop appearsLikely causeSection
The same https:// URL, foreverEvery pageA force-HTTPS rule that cannot see HTTPS behind a proxyCause 1
The same https:// URL for /wp-admin/ onlyLogin and dashboardFORCE_SSL_ADMIN with is_ssl() falseCause 2
https://www. then https:// then https://www.Front-end pagesHome URL host and a second rule disagree about wwwCause 3
http:// to https:// to http://Every pageTwo HTTPS rules in different layers pointing opposite waysCause 4
The Redirect Loop Signature Table: four ERR_TOO_MANY_REDIRECTS loop patterns and where to look first.

Cause 1: A Force-HTTPS Rule Behind a Proxy Causes ERR_TOO_MANY_REDIRECTS

This is the loop to rule out first whenever a CDN or reverse proxy sits in front of the site, and it is the one the diagram below shows. A CDN or reverse proxy accepts the visitor over HTTPS, then talks to your server over plain HTTP. A force-HTTPS rule at the origin sees an HTTP request, answers with a 301 to the HTTPS address, and the visitor comes straight back to the proxy. The origin never learns the visitor was already secure.

How a TLS-terminating proxy turns a force-HTTPS rule into an ERR_TOO_MANY_REDIRECTS loop Three boxes in a row: Browser, Proxy or CDN, WordPress origin. Arrows show HTTPS from browser to proxy, plain HTTP from proxy to origin, and a 301 to HTTPS coming back to the browser, repeating until the browser stops at its redirect limit. Browser asks for https:// Proxy or CDN ends TLS here WordPress is_ssl() is false HTTPS plain HTTP 301 to https:// … and the browser starts again After 20 redirects the browser gives up and shows ERR_TOO_MANY_REDIRECTS

How WordPress Decides a Request Is HTTPS

WordPress reads two server variables. The function is_ssl() returns true when $_SERVER['HTTPS'] is on or 1, or when no HTTPS variable exists and the port is 443 (WordPress 7.1.3, load.php lines 1659 to 1673). It does not read the X-Forwarded-Proto header a proxy adds. Behind a proxy that ends TLS, both variables describe the plain HTTP leg, so is_ssl() is false on every request.

The wp-config.php Fix for This ERR_TOO_MANY_REDIRECTS Loop

The WordPress developer documentation describes exactly this case: a site behind a reverse proxy that provides SSL, itself hosted without SSL, sends requests into an infinite redirect loop, and the remedy is to configure WordPress to recognize HTTP_X_FORWARDED_PROTO (Administration Over SSL). In practice that means a few lines in wp-config.php, above the require_once for wp-settings.php: if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) { $_SERVER['HTTPS'] = 'on'; }. Our lab used the same logic and it turned 51 requests into one (results below). Only use it when every request really arrives through your proxy, because a client that reaches the origin directly could send that header itself. Some proxies send a comma-separated list such as http,https, which the same page warns about, so test the value you actually receive.

The Second Way Out of This ERR_TOO_MANY_REDIRECTS Loop

The header trick is one fix, and changing the connection is the other. If the proxy connects to your server over HTTPS instead of plain HTTP, the web server itself reports a secure request, so is_ssl() is true with no code change at all. Which of the two you choose depends on whether the origin has a valid certificate for the proxy to connect to, and on who controls the proxy settings. Either way the goal is identical: the layer that decides to redirect must be told what the visitor actually used.

On Cloudflare this choice has a name: the SSL/TLS encryption mode. Flexible is the mode that produces this loop, because Cloudflare serves the visitor over HTTPS and then fetches from your origin over plain HTTP, which is exactly the arrangement the diagram above shows. In the Cloudflare dashboard, select the site, open SSL/TLS, then Overview, and change the mode from Flexible to Full (strict). Full (strict) requires a valid certificate on the origin, while Full accepts a self-signed one and still encrypts the leg to your server. Change the mode first and retest with curl before you edit wp-config.php, because the header fix ends the loop while leaving the connection to your server unencrypted.

Cause 2: FORCE_SSL_ADMIN Produces an ERR_TOO_MANY_REDIRECTS Loop on wp-admin Only

If the public pages load and only /wp-admin/ or wp-login.php loops, suspect this cause first. Two places in core redirect to HTTPS when FORCE_SSL_ADMIN is on and is_ssl() is false. The login file does it at line 15 of wp-login.php, and auth_redirect() does it for dashboard URLs at lines 1281 and 1293 of pluggable.php (WordPress 7.1.3).

The front end is untouched because neither code path runs there. That asymmetry is the clue, and it is why people lose an afternoon editing public-page rules that were never involved. The fix is the same as Cause 1, since both come from is_ssl() being false behind a TLS-terminating layer: make the HTTPS variable reflect the real request before wp-settings.php loads.

Cause 3: A www and Non-www Fight Creates an ERR_TOO_MANY_REDIRECTS Loop

WordPress sends the browser to the host in its Home URL setting. The canonical redirect takes its target host from home_url() (canonical.php lines 602 to 605), and it only acts when the difference is no-www versus yes-www (lines 731 to 738). If your Home URL says www and another layer sends www traffic to the bare domain, the two bounce between hosts.

The second rule can be a redirect in a DNS or proxy panel that was set up before the WordPress address changed, or the reverse. The signature is easy to spot in curl: the Location lines alternate between two hostnames. Pick one host, then set that host in the Home URL setting and in every rule that mentions it.

Why the Scheme Alone Rarely Triggers This One

The canonical comparison arrays hold host, path, port and query, and no scheme (canonical.php lines 740 to 750). So a scheme mismatch by itself does not make redirect_canonical() loop. It also runs only on the front end, because the function returns early when is_admin() is true (line 63), which matches the pattern that a www loop breaks public pages while the dashboard keeps working.

Cause 4: Two HTTPS Rules Cause the Last ERR_TOO_MANY_REDIRECTS Pattern

A site can end up with a force-HTTPS rule in .htaccess, another from a security or SSL plugin, and a third in the proxy panel. When they all agree, nobody notices. When one of them uses a different host or a different port, the browser alternates between two targets.

Apache’s own documentation says a redirect in a dedicated HTTP virtual host is the cleanest approach to forcing HTTPS, with a mod_rewrite alternative for .htaccess use (Apache mod_rewrite: when not to use it). The practical rule that follows is simple: one force-HTTPS rule, in one place. Where you cannot edit the virtual host, the single rule lives in .htaccess or in the plugin, never both. Our guide to free SSL and domain management covers where certificates and domain redirects normally sit.

What Our ERR_TOO_MANY_REDIRECTS Lab Measured

We reproduced three of the loops on 19 October 2026 so the numbers in this guide are first-hand. The setup was a PHP 8.5.10 origin that uses WordPress 7.1.3’s own is_ssl() and the redirect branches quoted above, a small TLS edge that ends HTTPS and forwards plain HTTP with X-Forwarded-Proto: https, and curl following redirects. It is a lab on one machine, not a customer site, and it is labeled that way so nobody reads it as production data.

Lab caseRedirects followedRequests the origin loggedOutcome
Force-HTTPS rule behind the edge5051curl stopped: Maximum (50) redirects followed
FORCE_SSL_ADMIN branch on /wp-admin/5051Same stop, only on the dashboard path
www to non-www edge rule vs canonical host5051 (26 non-www, 25 www)Hosts alternated on every hop
Same rule with X-Forwarded-Proto trusted first01HTTP 200 on the first request
Lab results, 19 October 2026: three loops reproduced and one fixed with the X-Forwarded-Proto line.

Two things stand out. Each loop costs the origin one request per hop, so a browser that stops at 20 redirects will have cost the origin about 21 requests, which is a quiet source of server load on a busy site. And the fix for the proxy case changed the result from 51 requests to one.

A Five-Step ERR_TOO_MANY_REDIRECTS Fix Order That Avoids Guessing

  1. Run curl -sIL --max-redirs 5 on the failing URL and write down the repeating Location values.
  2. Match them to the signature table, then change one rule only.
  3. Retest with curl, then in a private window, so a remembered redirect or an HSTS upgrade does not hide your fix (how HSTS works).
  4. If the loop only appears after a move, compare the redirect rules on the old and new site, starting with our WordPress migration steps.
  5. Only now disable plugins one at a time, because a plugin that adds a redirect will show up as a rule in the chain.

If you run a CDN in front of the site, our guide to LiteSpeed Cache and a CDN together lists the settings that tend to collide with an HTTPS redirect.

ERR_TOO_MANY_REDIRECTS Loop Diagnoser

Show the likely cause
Pick both answers, then press the button.

What to Record Before You Ask for Help With ERR_TOO_MANY_REDIRECTS

A loop report is only as useful as the evidence attached to it. Collect four things first, because each one rules out a cause in seconds. The exact URL that loops, copied from the address bar. The full output of curl -sIL --max-redirs 5 for that URL. Whether a CDN, proxy or DNS-level redirect service sits in front of the site. And the last change made before it started, whether that was a migration, a new SSL plugin, or an edit to the WordPress Address or Site Address fields.

That last item matters more than it looks. A loop that begins right after a change was almost certainly caused by that change, and reversing it is faster than any diagnosis. The signature table then tells you what you reversed, which is how you avoid repeating it.

When ERR_TOO_MANY_REDIRECTS Points at Something You Cannot Edit

Some loops live in a layer you do not control: a proxy panel, a reseller’s DNS service or a managed-hosting rule. When the curl output names a hostname that your account does not manage, you are done diagnosing and the next step is a ticket with that output attached. If your hosting and TLS arrangement is the open question, our SSL certificate options page and the shared hosting plans list what each plan includes.

For the hosting side of a WordPress setup, see our WordPress hosting plans. If the loop is already live and the curl output is in front of you, open a ticket with that output, with any Set-Cookie lines removed, and we will look at it with you.

Frequently Asked Questions: ERR_TOO_MANY_REDIRECTS in WordPress

How do I fix ERR_TOO_MANY_REDIRECTS on a WordPress site?

Specifically, run curl -sIL on the failing URL and read the Location headers. The two URLs that repeat name the two layers fighting, and the fix is to make one layer stop redirecting.

Why does ERR_TOO_MANY_REDIRECTS appear only on wp-admin and the login page in 2026?

Typically because FORCE_SSL_ADMIN is on while WordPress cannot see that the request arrived over HTTPS. The login code redirects to HTTPS, the proxy forwards plain HTTP again, and the loop never ends. The signature table above shows the curl output to expect.

Does a 301 vs 302 status matter when debugging an ERR_TOO_MANY_REDIRECTS loop?

In practice, it matters for the browser, not for the cause. A browser may remember a permanent redirect, so test with curl or a private window, because curl keeps no cache and shows every hop as the server sends it.

Should an .htaccess rule vs the WordPress address setting force HTTPS in 2026 without an ERR_TOO_MANY_REDIRECTS loop?

Ultimately, use one place only. Apache documents a redirect in a dedicated HTTP virtual host as the cleanest approach, with mod_rewrite as the .htaccess alternative, and a second HTTPS rule in a plugin or proxy is how the loops start.

Will moving to AHosting stop an ERR_TOO_MANY_REDIRECTS loop that started on my old host?

In fact, not by itself, because the loop comes from redirect rules that travel with the site files and database. Instead, compare the curl chain before and after the move, and check the migration steps in our migration guide before changing any rule.

What should I send AHosting support for an ERR_TOO_MANY_REDIRECTS loop in 2026?

In particular, send the output of curl -sIL –max-redirs 5 on the failing URL with any Set-Cookie lines removed, plus whether a CDN or proxy sits in front of the site. That output shows which hostnames and schemes repeat, so nobody has to guess the cause.

Can page caching on AHosting hide or cause an ERR_TOO_MANY_REDIRECTS loop in wp-admin?

In contrast to public pages, a logged-in admin session is uncacheable, so every wp-admin request reaches PHP and the redirect code runs each time. Caching therefore neither causes nor cures that loop, and the fix lives in the redirect rules.

How many redirects does a browser follow before showing ERR_TOO_MANY_REDIRECTS?

Specifically, the Fetch standard stops at 20 redirects and Chromium sets its limit to 20. Command-line curl follows up to 50 by default when you ask it to follow redirects, which is why a loop shows a count of 50 there.

Why does ERR_TOO_MANY_REDIRECTS appear after I set www as the preferred domain?

Notably, WordPress sends non-www requests to the host in its Home URL setting, so a second rule that sends www back to non-www at the DNS panel, proxy or .htaccess makes the two bounce forever. Keep one preferred host in both places.

Can HSTS keep an ERR_TOO_MANY_REDIRECTS loop alive after I fix the server in 2026?

Indeed, a site that sent an HSTS header makes the browser upgrade http:// URLs for that domain to HTTPS on its own, so an HTTP-based test can behave differently in the browser than in curl. Retest with curl and a fresh private window before changing rules again.

Related posts:

AHosting card on the REST API encountered an error, showing the three Site Health REST labels and what failed for each one.The REST API Encountered an Error? WordPress Never Reached It What Is A CDN?What IS A Content Delivery Network, Exactly? AHosting card on page cache is not detected in WordPress Site Health, showing four of the sixteen homepage headers the test accepts as proof.Page Cache Is Not Detected: What WordPress Site Health Actually Checks AHosting card on the authorization header is missing, showing the two Site Health failure labels and the four cases a flush misses.The Authorization Header Is Missing? What Site Health Tested, and the Fix
«Open Registration With Privileged Default Role? What Site Health Is Telling You
Sorry, You Are Not Allowed to Access This Page in WordPress: Find the Cause»

Categories

  • CMS
  • Concrete5
  • Drupal
  • FFmpeg / Video Hosting
  • Hosting Guides
  • How To
  • Joomla
  • Security
  • SEO
  • Uncategorized
  • Video Content
  • Web Hosting News
  • WooCommerce
  • WordPress

Lets Connect!

  • X
  • Facebook
  • LinkedIn
  • Instagram
  • YouTube
  • Pinterest
Ahosting Logo

Hosting

  • WordPress Hosting
  • Web Hosting
  • FFmpeg Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • VPS Hosting
  • Dedicated Server

Domain

  • Register a Domain
  • Domain Transfer
  • Premium SSL Certificate

Support

  • Knowledge Base
  • Abuse Report
  • Submit A Ticket

Company

  • Compare Hosts
  • About Us
  • Datacenter
  • Contact Us
  • Blog
  • Sitemap

Legal

  • Privacy Policy
  • Terms of Service
  • Acceptable Use Policy
  • Service Level Agreement
  • Resource Abuse Policy
  • Hosting
    • WordPress Hosting
    • Web Hosting
    • FFMpeg Hosting
    • WooCommerce Hosting
    • Reseller Hosting
    • VPS Hosting
    • Dedicated Server
  • Domain
    • Register a Domain
    • Domain Transfer
    • Premium SSL Certificate
  • Support
    • Knowledge Base
    • Abuse Report
    • Submit A Ticket
  • Company
    • About Us
    • Datacenter
    • Contact Us
    • Blog
    • Sitemap
  • Legal
    • Privacy Policy
    • Terms of Service
    • Acceptable Use Policy
    • Service Level Agreement
    • Resource Abuse Policy

Copyright © 2026 All Rights Reserved

Ahosting, Inc. BBB Accredited Business, A+ rating
Facebook X/Twitter Instagram LinkedIn YouTube
Limits printed per plan, not hidden WP Bronze: 30 entry processes, 2 GB memory, LiteSpeed + LSCache
$2.79/mo same price at renewal
Start for $2.79/mo 30-day money-back · free migration ★★★★★4.5 Trustpilot

WordPress 36-month term · $100.44 today

WP Bronze $2.79/mo WP Silver $3.79/mo WP Gold $4.79/mo Compare WordPress

WooCommerce

WooStart $3.79/mo WooPower $16.79/mo Compare WooCommerce

FFmpeg

FFStart $16.79/mo FFPower $28.79/mo Compare FFmpeg

Web hosting

Bronze $2.79/mo Silver $3.79/mo Gold $4.79/mo Compare Web hosting
Limits printed per plan, not hidden ★ 4.5 Trustpilot
Start for $2.79/mosame price at renewal · 30-day money-back