IT Error Decoder

How to Fix Vercel: Too Many Redirects (308 loop)

Last reviewed

Error message

ERR_TOO_MANY_REDIRECTS — site redirects from <a> to <b> to <a> in a loop.

Redirect loops are a routing problem, not a code bug. The fix is in DNS or in your config — not in your components.

What this error means

The browser followed redirects until it gave up. The site is bouncing between two URLs (or more) in a cycle.

Why this happens

Most often: Cloudflare Flexible SSL fighting Vercel's HTTPS redirect, conflicting `redirects()` rules in next.config.js, or a domain/alias misconfiguration where www and apex redirect to each other.

Quick fix (for end users)

  • Open the site in private mode and watch the URL bar — it'll cycle between two URLs.
  • Note both URLs and check what's redirecting each.

Admin / engineer fix

  • If using Cloudflare, switch SSL/TLS mode to Full or Full (strict). Flexible SSL strips HTTPS at Cloudflare and Vercel redirects http back, looping forever.

  • Pick one canonical URL (apex or www) and redirect the other to it — never both ways.

    command
    // vercel.json
    {
      "redirects": [
        { "source": "/(.*)", "destination": "https://your-domain.com/$1", "permanent": true, "has": [{ "type": "host", "value": "www.your-domain.com" }] }
      ]
    }
  • Check Vercel's Domains tab — both apex and www should be listed, with one of them set as the redirect target.

Step-by-step fix

  1. Identify the two URLs in the loop.

  2. Find the redirect rule for each (DNS, Cloudflare, Vercel, or next.config.js).

  3. Make them agree on a single canonical URL.

Affected products

Vercel · Cloudflare · Next.js

Common variations of this error

People also see these phrasings of the same problem:

  • ERR_TOO_MANY_REDIRECTS Vercel
  • infinite redirect loop

Still broken? Try these

  • Disable Cloudflare proxy temporarily (gray cloud) and retest. If it works, the loop was at Cloudflare.
  • Clear browser cache between tests — 308 redirects are aggressively cached.

Related errors

Related searches

  • err_too_many_redirects vercel
  • cloudflare ssl loop

Frequently asked questions

Why does Cloudflare cause this?

Cloudflare Flexible SSL talks HTTPS to the browser but plain HTTP to your origin. Vercel sees HTTP and redirects to HTTPS, which Cloudflare answers with HTTP again — endless loop. Use Full or Full (strict) instead.

Browse more errors in Vercel: Fix Vercel deployment errors. Build failures, missing output directories, exceeded build duration, missing env vars, and module resolution issues. Or paste your own error into the error decoder tool to find a match. You can also go back to the homepage to browse common errors by topic.