Redirect Error

ERR_TOO_MANY_REDIRECTS

Last updated: April 2026

Browser Error
This page isn't working. yoursite.com redirected you too many times. ERR_TOO_MANY_REDIRECTS

The browser followed more redirects than its limit (20) without reaching a final destination. Two or more rules are redirecting to each other in a loop. Check DevTools → Network tab to see the redirect chain.

Follow your redirect chain live →

Cause 1 — Cloudflare SSL/TLS mode set to Flexible

The most common cause. Cloudflare Flexible mode sends HTTP to your origin. If your origin also redirects HTTP to HTTPS, you get an infinite loop.

# Fix: Cloudflare Dashboard → SSL/TLS → Overview
# Change from "Flexible" to "Full" or "Full (Strict)"
# Full: Cloudflare connects to origin over HTTPS (self-signed cert OK)
# Full (Strict): requires a valid SSL certificate on your origin

Cause 2 — Nginx behind a load balancer or proxy

Nginx sees HTTP from the proxy and redirects to HTTPS, but the proxy already handles SSL termination. The loop: Nginx → HTTPS redirect → proxy → HTTP to Nginx → repeat.

server {
    listen 80;
    server_name yoursite.com;

    # Fix: trust the X-Forwarded-Proto header from the proxy
    if ($http_x_forwarded_proto = "http") {
        return 301 https://$host$request_uri;
    }

    # Or: only redirect if the request is not already HTTPS
    # and not coming through a proxy
}

Cause 3 — WordPress behind a proxy

# wp-config.php — tell WordPress the site is HTTPS
define('FORCE_SSL_ADMIN', true);
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {
    $_SERVER['HTTPS'] = 'on';
}

Cause 4 — conflicting redirect rules

# Check for conflicting rules:
# 1. Nginx redirect + Cloudflare Page Rule redirecting to same URL
# 2. .htaccess RewriteRule + WordPress redirect both active
# 3. vercel.json redirects conflicting with Next.js redirects

# Fix: disable redirects at one layer and let one system handle it

Diagnose the loop

# Follow redirects with curl and see where the loop starts
curl -L -v --max-redirs 5 https://yoursite.com 2>&1 | grep "Location:"
📚 HttpFixer Blog — fix guides, explainers, and references →