ERR_TOO_MANY_REDIRECTS (“This page isn’t working — example.com redirected you too many times”) means the browser got caught in a loop: URL A redirects to B, and B redirects back to A. In WordPress, the cause is almost always a disagreement between layers about HTTPS or the canonical hostname.

First, see the loop

curl -sIL https://example.com | grep -iE '^(HTTP|location)'
HTTP/2 301
location: http://example.com/
HTTP/1.1 301 Moved Permanently
location: https://example.com/
HTTP/2 301
location: http://example.com/
…

The Location headers show which redirects bounce back and forth — HTTP↔HTTPS, or www↔non-www. Also clear cookies and try a private window; old cookies and cached redirects can keep a fixed loop alive in your browser.

Cause 1: Cloudflare “Flexible” SSL

The most common cause by far. In Flexible mode, Cloudflare talks to your server over HTTP even when the visitor uses HTTPS. Your server (or WordPress) sees HTTP and redirects to HTTPS → Cloudflare fetches over HTTP again → loop.

Fix: install a certificate on your server (free Let’s Encrypt, or a Cloudflare Origin Certificate) and set Cloudflare SSL/TLS mode to Full (strict). See Cloudflare and your VPS.

Cause 2: HTTPS behind a proxy or load balancer

Any proxy that terminates TLS (a load balancer, Nginx Proxy Manager on another host, Traefik) forwards plain HTTP to WordPress. WordPress thinks the request is insecure and redirects. Tell WordPress to trust the forwarded protocol, in wp-config.php:

if ( ( $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '' ) === 'https' ) {
    $_SERVER['HTTPS'] = 'on';
}

…and make sure the proxy sends X-Forwarded-Proto (proxy_set_header X-Forwarded-Proto $scheme; in Nginx). Only do this when requests can only arrive through the trusted proxy.

Cause 3: home and siteurl don’t match the server rules

If WordPress’s addresses say http:// while the server forces HTTPS — or say www while the server redirects to non-www — they loop. Check:

cd /var/www/example.com
sudo -u www-data wp option get home
sudo -u www-data wp option get siteurl

Both should be exactly the canonical URL, e.g. https://example.com. Fix:

sudo -u www-data wp option update home 'https://example.com'
sudo -u www-data wp option update siteurl 'https://example.com'

Or temporarily force them in wp-config.php (useful when you’re locked out of wp-admin):

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

See changing the WordPress site URL.

Cause 4: conflicting server redirects

Two layers both redirecting — for instance Nginx sends www → non-www while a rule elsewhere sends non-www → www. Review all redirect sources:

sudo nginx -T | grep -nE "return 30|rewrite"
grep -n "Redirect\|RewriteRule" /var/www/example.com/.htaccess   # Apache

Keep one canonical rule set — see Nginx HTTP to HTTPS and www redirects.

Cause 5: plugins

  • SSL plugins (forcing HTTPS) combined with server redirects or proxies.
  • Redirect plugins with a rule that matches its own target.
  • Multilingual plugins redirecting between language URLs.
  • Security plugins forcing login URLs or HTTPS on admin.

Disable plugins without wp-admin access:

sudo -u www-data wp plugin deactivate --all --skip-plugins

Reactivate one by one to find the culprit.

Cause 6: wp-admin only

A loop only on /wp-admin or the login page usually involves FORCE_SSL_ADMIN, cookie domain settings or a mismatch between siteurl and the URL you log in on. Check COOKIE_DOMAIN in wp-config.php (remove it unless you’re running multisite with mapped domains), and clear browser cookies.

Cause 7: caching

A page cache, CDN or browser may have stored a redirect response. After fixing the configuration, purge:

  • the WordPress cache plugin’s cache (wp cache flush plus the plugin’s purge),
  • Nginx FastCGI cache if used,
  • the CDN cache,
  • your browser cache (or test in a private window).

Checklist

  1. curl -sIL — which hops loop?
  2. Cloudflare in Flexible mode? → Full (strict).
  3. Proxy in front? → X-Forwarded-Proto handling.
  4. home/siteurl = canonical URL?
  5. Only one set of server redirects?
  6. Disable plugins to test.
  7. Purge every cache layer.

Related: moving WordPress to HTTPS and migrating WordPress to a VPS.

  • WordPress
  • Troubleshooting
  • SSL