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
How to tell: Cloudflare talks to your server over http, your server sends it back to https, forever. The site uses Cloudflare.
How to tell: Settings, General shows http in one field and https in the other, or www in one only.
How to tell: The host forces https, and a plugin or .htaccess rule forces it again in a different way.
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
Try a private window
If it works there, clear the cookies for the site and you are done.
-
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
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
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
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.
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.