Fixing WordPress redirect loops (ERR_TOO_MANY_REDIRECTS)

How to diagnose and fix WordPress redirect loops by checking URL configuration, SSL settings, .htaccess rules, plugin conflicts, CDN settings and cached redirects.

Fixing WordPress redirect loops (ERR_TOO_MANY_REDIRECTS)

A redirect loop occurs when your browser is told to go to a URL, which redirects it to another URL, which redirects it back to the first one (or through a chain that eventually circles back). The browser detects this cycle and stops trying, displaying an error message like "ERR_TOO_MANY_REDIRECTS" in Chrome, "The page isn't redirecting properly" in Firefox or "Safari Can't Open the Page" in Safari.

This is a common WordPress issue, and it almost always comes down to a conflict between two or more things that are each trying to control where the browser should go. The most frequent triggers are switching to HTTPS without fully consistent configuration, changing domains, mismatched URL settings in WordPress or conflicting redirect rules between WordPress, your server and a CDN or proxy service.

The good news is that once you identify which layer is creating the conflict, the fix is usually straightforward.

Clear cookies and cache first

Before investigating configuration issues, rule out the possibility that the loop is being caused by stale data in your browser or a caching layer.

Clear your browser cookies for the specific domain (not just general browsing data), then try loading the site again. You can also test in an incognito or private browsing window to bypass stored cookies entirely.

If your site uses a caching plugin or your hosting provider has server-side caching, clear those caches as well. A cached redirect from a previous configuration can persist even after you've fixed the underlying issue.

Check your WordPress and site URLs

WordPress stores two URL values that control how it generates links and handles requests: the WordPress Address (URL) and the Site Address (URL). If these don't match each other exactly, or if they use a different protocol or subdomain format (for example, one with www and one without, or one with http and the other with https), WordPress can get stuck in a loop trying to reconcile the difference.

If you can access the dashboard, go to Settings → General and verify that both values are identical, with the same protocol and the same format.

If you're locked out of the dashboard because of the redirect loop, you can override these values in wp-config.php. Add the following lines just above the comment that reads /* That's all, stop editing! */:

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

Replace https://example.com with your actual domain, making sure the protocol matches your setup. Use https:// only if you have an active SSL certificate, and be consistent about whether you include www or not.

Review your HTTPS and SSL configuration

Switching from HTTP to HTTPS is the single most common trigger for redirect loops in WordPress, because there are multiple places where an HTTPS redirect can be configured, and having more than one active at the same time creates a conflict.

You only need one canonical redirect from HTTP to HTTPS. Check for redirect rules in all of the following locations and make sure only one is active:

Your .htaccess file may contain a RewriteRule that redirects HTTP requests to HTTPS. Your hosting control panel may have a "Force HTTPS" or "SSL Redirect" option enabled. An SSL or security plugin in WordPress may be adding its own redirect. And if you're using a CDN or reverse proxy, it may be handling the redirect at the edge.

If two or more of these are active simultaneously, a request can bounce between them. Pick one source of truth for the HTTPS redirect and disable the others.

Also check that your SSL certificate is valid and not expired. An expired or misconfigured certificate can cause browsers to fall back to HTTP, which then gets redirected to HTTPS, which fails again because of the certificate, creating a loop.

Check CDN and reverse proxy settings

If your site sits behind a CDN or reverse proxy service, the way traffic flows between the proxy and your server can cause redirect loops.

The most common scenario is this: the proxy connects to your origin server over HTTP (even though visitors access the proxy over HTTPS). Your server sees the HTTP connection and redirects to HTTPS. The proxy receives this redirect, follows it and connects again, but still over HTTP. This creates a continuous loop.

To fix this, check the SSL/TLS mode in your CDN or proxy settings. It should typically be set to "Full" or "Full (Strict)", which means the proxy connects to your origin over HTTPS rather than HTTP. A "Flexible" SSL mode (where the proxy connects to the origin over HTTP) is the most common cause of this type of loop.

Also review any page rules or redirect rules configured in your CDN that might be creating additional redirects on top of those already handled by WordPress or your server.

If you're not sure whether the CDN is involved, temporarily pause or bypass the service and load the site directly to see if the loop resolves.

Reset .htaccess

If your .htaccess file contains conflicting or malformed redirect rules, it can cause a loop independently of any other configuration.

Connect via FTP, SFTP or your hosting file manager and rename .htaccess to .htaccess_old. Try loading the site. If the loop stops, the file was the problem.

Regenerate a clean .htaccess by logging into the WordPress dashboard and going to Settings → Permalinks, then clicking Save Changes without altering anything.

If you need a canonical redirect (such as non-www to www, or HTTP to HTTPS), add a single set of rewrite rules to the file. Avoid adding multiple redirect blocks that handle the same thing, as overlapping rules are one of the most common causes of loops in .htaccess.

If your server runs Nginx rather than Apache, there is no .htaccess file. Check your Nginx configuration with your hosting provider instead.

Check server-level redirects

Some hosting control panels allow you to configure redirects separately from WordPress, typically in a "Redirects" section or as part of the domain management settings. These redirects operate at the server level and are processed before WordPress even loads, which means they can conflict with redirect rules in .htaccess or in your WordPress plugins.

Check your hosting control panel for any active redirect rules and make sure they're not duplicating redirects that are already being handled elsewhere.

Disable plugins and switch themes

Plugins that manage redirects, handle SEO or enforce security rules can all create redirect loops, particularly if they conflict with server-level rules or with each other.

If you can access the dashboard, deactivate plugins one at a time, starting with any SEO, security or redirect management plugins, and check whether the loop clears after each one.

If you're locked out, connect via FTP or your hosting file manager and navigate to wp-content/plugins/. Rename each plugin folder one at a time (for example, change plugin-name to plugin-name-disabled) and test the site after each one.

To rule out a theme issue, rename your active theme's folder inside wp-content/themes/. WordPress will fall back to a default theme if one is installed.

Update URLs after a migration

If you've recently moved your site to a new domain, old URLs stored in the database can create redirect loops. This happens when the old domain is set up to forward to the new one, but content in the database still references the old domain, causing WordPress to redirect back.

You can update all URLs in the database using WP-CLI:

wp search-replace 'http://olddomain.com' 'https://newdomain.com' --all-tables

Replace the domains with your actual old and new URLs. This command searches every database table and replaces all instances of the old URL with the new one. If you don't have WP-CLI access, you can do this through phpMyAdmin by running SQL queries against the relevant tables, though this is more involved and requires care to avoid breaking serialised data.

Still stuck in a redirect loop?

Redirect loops can be difficult to diagnose when multiple layers (WordPress, server configuration, CDN) are all involved. My emergency WordPress support service can help trace the redirect chain, identify conflicting rules and resolve persistent loops.

Adam Greenough

Written by Adam Greenough

Freelance web developer with over 15 years of experience building and fixing WordPress sites. I work with businesses across the UK on everything from emergency support to full builds.

Need hands-on help?

I offer emergency WordPress support with a no-fix, no-fee guarantee.