Fix ERR_TOO_MANY_REDIRECTS in WordPress: the redirect loop error
The error “This page isn’t working: redirected you too many times” (ERR_TOO_MANY_REDIRECTS) happens when two rules send the visitor from one address to another in a loop, until the browser gives up. In WordPress, the most common causes are mismatched http and https addresses, an SSL plugin, rules in the .htaccess file, a misconfigured cache or CDN, and old cookies.
This article is for anyone who manages a WordPress site and got stuck with this error, including those who can’t even log in to the admin panel. You’ll see how to test the causes in order, from the simplest to the most involved, and how to undo each change.
Before you start
- Make a copy of anything you’re going to change. Download the
.htaccessandwp-config.phpfiles before editing them and, if you can, have a full WordPress backup. - Change one thing at a time and test the site after each step.
- Rename files instead of deleting them. That way, everything can be undone.
What does ERR_TOO_MANY_REDIRECTS mean?
The browser requests a page, the server responds “go to another address,” and that other address responds “go back to the first one.” After a few rounds, the browser stops and shows the error. The problem is not on your computer. It’s a redirect rule that contradicts another one.
Step 1: test in a private window and clear cookies
Old WordPress cookies can cause a loop, especially at login.
- Open the site in a private (incognito) window.
- If it works, clear the cookies and the browser cache for your domain and try again.
- If the error persists even in a private window, the problem is on the site or the hosting. Move on to step 2.
Step 2: check the WordPress addresses
If the WordPress address is set to http:// and the server forces https://, the two keep sending each other back and forth. This is one of the most common causes.
If you can access the admin panel, go to Settings > General and check the WordPress Address (URL) and Site Address (URL) fields. Both should use the same protocol and the same format, with or without www, that your site actually uses.
Without access to the admin panel, you can fix the addresses in wp-config.php, above the line that says “That’s all, stop editing”:
define( 'WP_HOME', 'https://yourdomain.com' );
define( 'WP_SITEURL', 'https://yourdomain.com' );
When these constants exist, they override what is in the database. Once the site is back, adjust the addresses under Settings > General and remove the lines if you don’t want to keep them. More details in how to change the domain or address of a WordPress site.
Step 3: disable the SSL plugin and redirect plugins
Plugins that force https, handle redirects, or change www can conflict with the hosting’s rule.
- In cPanel, open File Manager and go to
wp-content. - Rename the
pluginsfolder toplugins-off. All plugins will be deactivated. - Test the site. If it’s back, rename it back to
pluginsand deactivate the plugins one by one from the admin panel until you find the culprit.
If the culprit is the SSL plugin, configure it so that only one place forces https: the plugin, the server, or the CDN, never two at the same time.
Step 4: check the .htaccess file
Duplicate or invalid rules in the .htaccess file also cause the loop.
- Download a copy of the
.htaccessfile from the site’s folder. - Rename the file to
.htaccess-antigo. - Test the site. If it’s back, go to Settings > Permalinks and click Save Changes so WordPress generates a new file.
If your site needs a redirect to https, add it back carefully, above the WordPress block. The default block and the step-by-step instructions are in WordPress .htaccess: how to find and create the default file.
Step 5: review SSL and the CDN
If your domain goes through a CDN or protection service, such as Cloudflare, the encryption mode matters. In a mode that connects to your server without HTTPS (for example, “Flexible” in Cloudflare), the CDN talks to the server over http, the server or plugin redirects to https, and the loop forms.
- Install a valid certificate on the server. In cPanel, see how to install SSL.
- Configure the CDN to connect to the server using HTTPS.
- Clear the CDN cache after any change.
Step 6: clear the site cache
A cache plugin may be storing an old redirect response. Clear the cache from the plugin’s panel or, without access to the panel, rename the cache plugin’s folder in wp-content/plugins. See also what a cache plugin is for.
Frequently asked questions
What causes the ERR_TOO_MANY_REDIRECTS error in WordPress?
A conflict between redirect rules. It’s usually the difference between http and https in the WordPress addresses, an SSL plugin, rules in the .htaccess file, or a CDN configured in a way that doesn’t match the server.
Does clearing cookies fix the error?
It does when the cause is old cookies, which usually shows up only in your browser. If the error also happens in a private window or on another device, the problem is on the site.
Can I fix it without accessing the WordPress admin panel?
Yes. Using cPanel’s File Manager, you can set the addresses in wp-config.php, or rename the plugins folder or the .htaccess file. Always keep a copy before making changes.
Why did the error appear after I installed SSL?
Most likely the WordPress addresses are still set to http, while the server or a plugin forces https. Change both addresses to https, as in step 2.
Can changing from www to non-www cause this error?
Yes, if two rules try to do the opposite of each other, for example one that adds www and another that removes it. Choose one format and use it consistently in WordPress, the .htaccess file, and the CDN.
After fixing it, what should I check?
Open the homepage, an inner page, and the admin login, and check that the padlock appears. If you see a mixed content warning, see WordPress without the padlock: mixed content and HTTPS.
If none of the steps solve the problem, the MigraCloud support team can help: contact us through the contact page and include the error message and what you have already tested.