Website errorsWordPress and CloudflareUpdated 6 min read

How to fix ERR_TOO_MANY_REDIRECTS (“redirected you too many times”)

Your site “redirected you too many times”? Find the loop behind ERR_TOO_MANY_REDIRECTS in Cloudflare, WordPress or .htaccess and fix it, step by step.

Quick answer

ERR_TOO_MANY_REDIRECTS means your site keeps sending the browser from one address to another and back again, so the browser gives up. Clear the cookies for that site first to rule out your own browser. If the loop is still there, the usual causes are Cloudflare’s SSL mode set to Flexible while your server forces HTTPS, a WordPress Address and Site Address that do not match, or two sets of redirect rules that disagree.

Why this happens

  • Old cookies or a remembered redirect

    Browsers keep cookies and remember some redirects. If they are out of date, your browser can keep looping even after the site is fixed, which is why a site can fail for one person and work for another.

  • Cloudflare SSL set to Flexible

    HTTPS is the secure version of your address, the one with the padlock. With Flexible, Cloudflare talks to your server over plain HTTP. If your server or WordPress then redirects every HTTP request to HTTPS, Cloudflare asks again over HTTP, is redirected again, and the loop never ends.

  • WordPress Address and Site Address do not match

    WordPress stores two addresses in Settings > General. If one uses http and the other https, or one has www and the other does not, WordPress and your server can keep correcting each other.

  • Conflicting .htaccess rules

    .htaccess is a settings file on Apache and LiteSpeed servers that holds redirect rules. Two rules that send visitors in opposite directions, for example to www and away from www, make a loop.

  • Plugins fighting each other

    An SSL plugin, a redirect plugin and a caching plugin can each try to force HTTPS or a preferred address. When they disagree with each other or with your host, the browser bounces between them.

  • www rules on both the host and the CDN

    A CDN (content delivery network) such as Cloudflare sits in front of your server. If the CDN sends visitors to www and your host sends them back to the address without www, neither one ever stops.

How to fix it, step by step

  1. Step 1: Rule out your own browser

    Open the site in a private or incognito window. If it loads there, clear the cookies and site data for that one site in your normal browser (in Chrome, click the icon to the left of the web address and open the site settings), then try again. If the private window shows the same error, the problem is on the site itself, so carry on.

  2. Step 2: Check Cloudflare’s SSL mode

    If your site uses Cloudflare, log in, choose your domain and open SSL/TLS. If the encryption mode is Flexible, change it to Full (strict). Full (strict) needs a valid SSL certificate on your host, and most hosts provide one free. If your host only has a self-signed certificate for now, choose Full. Wait a minute, then test again in a private window.

  3. Step 3: Make the WordPress Address and Site Address match

    In the dashboard, go to Settings > General. In most setups both addresses should be identical, start with https:// and use the same version of your domain, with or without www. In the database they are stored as siteurl (WordPress Address) and home (Site Address).

    If you cannot log in, add the two lines below to wp-config.php, above the “That’s all, stop editing!” line, with your own domain in place of the example. While these lines are there, the two fields in Settings > General are grayed out.

    define( 'WP_HOME', 'https://www.example.com' );
    define( 'WP_SITEURL', 'https://www.example.com' );
  4. Step 4: Reset your .htaccess file

    If your host runs Apache or LiteSpeed, open File Manager, turn on the option to show hidden files and find .htaccess in the main folder of your site. Rename it to .htaccess-old. If the home page now loads, the old rules were the problem. Log in, go to Settings > Permalinks and click Save Changes so WordPress writes a clean file, then add back only the one HTTPS or www rule you really need. Inner pages may show “not found” until you save the permalinks. Sites on Nginx servers have no .htaccess; their redirects live in the server settings, so ask your host.

  5. Step 5: Turn off redirect and SSL plugins

    If you use plugins to force HTTPS, manage redirects or cache pages, turn them off one at a time and test after each. If you cannot reach the dashboard, rename the plugin’s folder in wp-content/plugins. When the loop stops, you have found the plugin that disagrees with your other settings. Keep only one place in charge of forcing HTTPS.

  6. Step 6: Choose one address and set the redirect in one place

    Decide whether your site lives at www.example.com or example.com, and use that version everywhere: in WordPress, in your host’s settings and in Cloudflare. Then set the redirect from the other version in one place only. A rule on the host and an opposite rule on the CDN is a classic loop.

  7. Step 7: Clear caches and test again

    Purge the cache in Cloudflare (Purge Everything, under Caching) and in any caching plugin, then test in a fresh private window. Try a few pages with and without www, and with http:// and https://. Each one should land on your main address in a single step.

When to get help

Get help if the loop only happens on some pages, if you are not sure whether your host, Cloudflare or a plugin is in charge of redirects, or if a settings change has locked you out of the dashboard. Dawnwire tracks down and fixes a redirect loop like this for a fixed $49.

Frequently asked questions

Why does the site work for me but not for my customers?

Each browser keeps its own cookies and remembered redirects. One person can have an old cookie that causes a loop while others do not, or the other way round. Testing in a private window shows what a new visitor sees.

What does this error look like in other browsers?

Chrome and Edge say the page “redirected you too many times” and show the code ERR_TOO_MANY_REDIRECTS. Firefox says “The page isn’t redirecting properly”. Safari says too many redirects occurred. It is the same problem in every case.

Is Cloudflare’s Flexible SSL mode safe?

Only partly. Flexible encrypts the connection between the visitor and Cloudflare, but not between Cloudflare and your server. Full (strict) encrypts the whole way and checks your server’s certificate, so it is the better choice once your host has a valid certificate.

Will clearing cookies log me out?

If you clear cookies for that one site only, you are logged out of that site and nowhere else. Clearing all cookies logs you out of every site.

Can a redirect loop hurt my Google rankings?

Google cannot read a page that is stuck in a loop. A short problem is not usually a worry, but if it lasts, pages can drop out of search results, so fix it quickly.

Next step

Still stuck in a redirect loop?

Send us the site address and we will find which setting is fighting which. Dawnwire fixes a redirect loop like this for $49. Want a wider look first? Run the free website check.

Keep reading

All guides →