ERR_TOO_MANY_REDIRECTS on WordPress

PlatformWordPress Doing it yourself10 to 30 minutes Checked

The short answer

Two rules are sending visitors back and forth, usually one saying "go to https" and another saying "go to http", or www and no-www fighting. The most common cause is Cloudflare set to Flexible SSL on a site that already forces HTTPS. Set it to Full (strict) and make both WordPress addresses match.

Is this your problem?

  • The browser says "redirected you too many times" or ERR_TOO_MANY_REDIRECTS
  • Only wp-admin loops, the front works
  • It started after adding SSL, Cloudflare or a redirect plugin

What usually causes it

1
Cloudflare SSL set to Flexible

How to tell: Cloudflare talks to your server over http, your server sends it back to https, forever. The site uses Cloudflare.

2
The two WordPress addresses do not match

How to tell: Settings, General shows http in one field and https in the other, or www in one only.

3
Two layers of redirects

How to tell: The host forces https, and a plugin or .htaccess rule forces it again in a different way.

4
An old login cookie

How to tell: Only wp-admin loops, and a private window works.

Before you touch anything

  • Back up wp-config.php and .htaccess before editing.

How to fix it, step by step

  1. 1

    Try a private window

    If it works there, clear the cookies for the site and you are done.

  2. 2

    See the loop for yourself

    This command shows every hop. On a Mac or Linux it runs in Terminal. Where the addresses start repeating is the loop.

    curl -sIL https://example.com | grep -i -E "^(HTTP|location)"
  3. 3

    Fix Cloudflare

    In Cloudflare, go to SSL/TLS and set the mode to Full (strict). Your server needs a valid certificate for that, which most hosts provide free.

  4. 4

    Make both addresses match

    In Settings, General, set WordPress Address and Site Address to the same https address. If you cannot log in, set them in wp-config.php instead.

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

    Remove the duplicate redirect

    Keep one layer that forces https. If the host or Cloudflare already does it, remove the extra rule from .htaccess or turn off that setting in the redirect or SSL plugin.

Stop and get help if

  • The loop sends visitors to a different domain. That is a hack, see the guide on sites redirecting to another site.
  • You manage many redirect rules for an old site and one wrong change could lose search traffic.
Fix it for me

Stop it happening again

  • Decide once: https, and either www or not, and set it in one place.
  • Keep Cloudflare on Full (strict).

Questions people ask

Will this hurt my Google rankings?

A loop that lasts for days can, because Google cannot reach the pages. A short one does not.

Why does it work on my phone but not my laptop?

Usually an old cookie or cached redirect on the laptop.

Still broken? We can fix it.