How to Fix the ‘Too Many Redirects’ Error in WordPress

How to Fix the 'Too Many Redirects' Error in WordPress

Table of Contents

The “Too Many Redirects” error (often displayed by web browsers as ERR_TOO_MANY_REDIRECTS) is one of the most common and frustrating issues faced by WordPress website administrators. It completely blocks visitors and administrators from accessing a website, leading to potential loss of traffic, revenue, and search engine rankings.
This comprehensive guide will explain what the “Too Many Redirects” error means, why it happens, and step-by-step solutions to diagnose and fix it permanently.

Understanding the “Too Many Redirects” Error

What Does the Error Mean?

When a visitor attempts to access a webpage, their browser sends a request to the server housing the website. Under normal circumstances, the server processes the request and serves the requested page. However, if a redirection rule is misconfigured, the server tells the browser to go to a different URL.
If URL A redirects to URL B, and URL B redirects back to URL A (or through a loop such as A to B, B to C, and C to A), the browser enters an infinite redirect loop. Modern web browsers are programmed to detect this endless cycle after several attempts and break it by displaying an error message:
  • Google Chrome: “This page isn’t working. example.com redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS”

  • Mozilla Firefox: “The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”

  • Apple Safari: “Safari Can’t Open the Page. Too many redirects occurred trying to open ‘example.com’.”
  • Microsoft Edge: “This page isn’t working right now. example.com redirected you too many times.”

Common Causes of the Loop

The infinite redirection loop usually stems from conflicting configuration settings across different layers of your web stack. The most common triggers include:
  • Mismatched site URLs in WordPress settings (HTTP vs. HTTPS or www vs. non-www).
  • Misconfigured SSL certificates or flexible SSL settings in Content Delivery Networks (CDNs) like Cloudflare.
  • Faulty or misconfigured WordPress redirection plugins.
  • Corrupted .htaccess or server configuration files (Nginx / Apache).
  • Stale browser cache or corrupted domain-specific cookies.
  • Issues with third-party reverse proxies or load balancers stripping HTTPS headers.

Step 1: Clear Browser Cache and Cookies

Before modifying server files or database records, rule out local browser caching issues. Web browsers cache 301 (Permanent) redirects aggressively. If you recently changed a redirection setting on your server, your browser might still be enforcing an old redirect loop stored in its local memory.

How to Clear Local Cache and Test

  1. Try Incognito / Private Window: Open a private browsing window in your web browser and navigate to your website. If the website loads normally, the issue lies in your local browser cache or cookies.
  2. Clear Cookies for Your Specific Site: Instead of clearing your entire browser history, open your browser settings, search for site settings or cookies, find your domain name, and delete all cached files and cookies associated with it.
  3. Try a Different Browser or Device: Test the website using a different web browser or a mobile device connected to a cellular network to isolate the issue from local DNS or browser caching.
If the error persists across multiple devices and private windows, the issue is on the server side.

Step 2: Verify Your WordPress Site URLs

A frequent cause of redirect loops is a mismatch between your WordPress Address (URL) and Site Address (URL).
  • WordPress Address (URL): The address where your core WordPress application files are located.
  • Site Address (URL): The address visitors type into their browser to reach your website.
If one of these URLs uses http:// while the other uses https://, or if one contains www. and the other does not, WordPress may continually attempt to redirect between the two versions.
Ready to take your digital platform to the next level? Visit our website support Dubai page for reliable maintenance, or connect with our Dubai design agency to start your next web design project today.

Fixing URLs via the Admin Dashboard

If you can still access your WordPress admin dashboard (/wp-admin):
  1. Log into your dashboard.
  2. Navigate to Settings > General.
  3. Inspect both WordPress Address (URL) and Site Address (URL).
  4. Ensure both fields match exactly, including the protocol (http:// or https://) and prefix (www. or non-www).
  5. Scroll down and click Save Changes.

Fixing URLs via wp-config.php

If you are locked out of your admin dashboard due to the redirect loop, you can override these settings directly in your site’s core configuration file.
  1. Connect to your web server using an FTP client (like FileZilla) or your hosting control panel’s File Manager.
  2. Locate the wp-config.php file in the root directory of your WordPress installation.
  3. Edit the file and add the following two lines right above the line that says /* That's all, stop editing! Happy publishing. */:
PHP

define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');
(Replace [https://example.com](https://example.com) with your actual website URL).
  1. Save the file and reload your website in a browser.

Fixing URLs via the Database (phpMyAdmin)

If hardcoding the URLs in wp-config.php does not resolve the issue, update the values directly in the MySQL database:
  1. Log into your hosting account and open phpMyAdmin.
  2. Select your site’s database from the left sidebar.
  3. Open the wp_options table (note: your table prefix might differ from wp_).
  4. Find the option names siteurl and home.
  5. Edit both entries to ensure their option_value fields match your correct URL structure precisely.

Step 3: Troubleshoot SSL and HTTPS Misconfigurations

Installing an SSL certificate is essential for security and search engine optimization. However, improper SSL implementation is a leading cause of ERR_TOO_MANY_REDIRECTS.

The Cloudflare “Flexible SSL” Loop

If your website uses Cloudflare or another CDN reverse proxy, a specific setting called Flexible SSL frequently triggers redirect loops.
  • How Flexible SSL Works: Flexible SSL encrypts traffic between the visitor’s browser and Cloudflare, but uses unencrypted HTTP traffic between Cloudflare and your origin server.
  • Why the Loop Happens: Your origin server receives an unencrypted HTTP request from Cloudflare. If WordPress is configured to enforce HTTPS, it sends a 301 redirect back to Cloudflare saying “Please connect via HTTPS.” Cloudflare receives this redirect and requests the page again via HTTP from your origin server. The origin server again replies with a redirect to HTTPS, creating an infinite loop.

How to Fix Cloudflare SSL Loops

  1. Log into your Cloudflare Dashboard.
  2. Select your domain name.
  3. Click on the SSL/TLS tab in the sidebar navigation.
  4. Change your SSL encryption mode from Flexible to Full or Full (strict).
  5. Wait a few minutes for the DNS and SSL settings to propagate, then clear your browser cache and test your site.

Fixing SSL Reverse Proxies in wp-config.php

If your website runs behind a reverse proxy, load balancer, or flexible SSL system that terminates SSL before reaching your origin web server, WordPress may fail to detect that the original incoming request was HTTPS.
To fix this, instruct WordPress to recognize forwarded HTTPS headers by adding the following snippet to the very top of your wp-config.php file:
PHP

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
    $_SERVER['HTTPS'] = 'on';
}
This code tells WordPress that if the request reached the proxy server via HTTPS, it should treat the request as secure, preventing unnecessary redirect commands.

Step 4: Reset the .htaccess File (Apache Servers)

The .htaccess file is a core configuration file used by web servers running Apache or LiteSpeed. It contains server rules, including URL rewriting parameters for WordPress permalinks and manual redirection rules added by security or SEO plugins.
A corrupted .htaccess file or conflicting rewrite rules can force your web server into an endless loop.

Restoring Default .htaccess File

  1. Connect to your web server using an FTP client or File Manager.
  2. Locate the .htaccess file in the root directory (the same folder that contains wp-config.php).
  3. If you cannot see the file, ensure your FTP client is configured to Show Hidden Files (files beginning with a dot are hidden by default).
  4. Rename the file to .htaccess_old to back it up and disable its rules.
  5. Test your website in an incognito browser window.
If your site loads without errors, the issue was caused by a corrupted rule inside your .htaccess file.

Recreating a Clean .htaccess File

Once your site is accessible:
  1. Log into your WordPress admin dashboard.
  2. Go to Settings > Permalinks.
  3. Scroll to the bottom and click Save Changes (this automatically generates a fresh, clean .htaccess file).
Alternatively, create a new text file named .htaccess in your root directory and paste the standard WordPress rewrite rules into it:
Apache

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Step 5: Deactivate WordPress Plugins

Plugins extend WordPress functionality, but poor coding, outdated software, or conflicting redirect rules within plugins can cause severe site errors. Redirection plugins, caching tools, and security plugins are the primary culprits behind redirect loops.

Deactivating Plugins via Dashboard

If you have access to your WordPress dashboard:
  1. Navigate to Plugins > Installed Plugins.
  2. Select all plugins by checking the top box.
  3. Choose Deactivate from the Bulk Actions dropdown menu and click Apply.
  4. Test your website. If the error disappears, reactivate your plugins one by one, testing the site after each activation to identify the specific plugin causing the issue.

Deactivating Plugins via FTP or File Manager

If you cannot access the admin dashboard:
  1. Connect to your web server using FTP or File Manager.
  2. Navigate to the wp-content directory.
  3. Locate the plugins folder.
  4. Rename the plugins folder to plugins_old. This instantly deactivates all installed plugins without losing their individual configurations.
  5. Try accessing your website.
If the site loads successfully, rename plugins_old back to plugins. Then, log into your admin dashboard, go to the Plugins screen, and activate each plugin individually until you trigger the error again. Once identified, delete or reconfigure the problematic plugin.

Step 6: Clear Server-Side and CDN Caches

Caching improves website load speed by storing static snapshots of your pages. However, if a temporary redirect loop was cached at the server level or by a Content Delivery Network, visitors will continue to see the error even after you have fixed the underlying issue.

Clearing Server Caching

Depending on your web hosting provider, you may have server-level caching enabled (such as Nginx FastCGI Cache, Varnish, Redis, or proprietary hosting caches):
  • Managed WordPress Hosts: Log into your hosting control panel (such as SiteGround, WP Engine, Kinsta, or Hostinger) and locate the cache management tool. Click Clear Cache or Flush All Caches.
  • Caching Plugins: If you use caching plugins like WP Rocket, W3 Total Cache, or LiteSpeed Cache, clear their cache through the admin toolbar or plugin settings.

Clearing CDN Caching

If you use Cloudflare, Sucuri, or another CDN network:
  1. Log into your CDN dashboard.
  2. Navigate to the Caching or Performance section.
  3. Select Purge Everything or Flush Cache.
  4. Wait a minute for the global nodes to clear their stored content before retesting your site.

Step 7: Check Server Redirect Rules and Nginx Configurations

If your web server runs Nginx instead of Apache, it does not use .htaccess files. Instead, all redirection and URL rewriting rules are stored directly inside server configuration blocks (usually located in /etc/nginx/sites-available/ or /etc/nginx/conf.d/).

Common Nginx Configuration Errors

A common source of redirect loops in Nginx is conflicting server blocks or nested location directives attempting to enforce HTTP to HTTPS or www to non-www transitions simultaneously.
Review your Nginx site configuration file for conflicting directives like this:
Nginx

# Server block enforcing HTTPS redirect
server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}

# Incorrect location block inside HTTPS server causing loops
server {
    listen 443 ssl;
    server_name example.com;

    # Incorrect rewrite rule forcing http redirect again
    if ($scheme != "http") {
        return 301 http://$host$request_uri;
    }
}
Ensure that your Nginx configuration cleanly redirects HTTP traffic to HTTPS without secondary rules pushing traffic back to unencrypted protocols. After editing Nginx files, always run nginx -t in your server terminal to verify syntax before restarting the Nginx service.

Step 8: Verify Search Engine and Domain Settings

Sometimes, redirect loops originate above the server level in your Domain Name System (DNS) settings or third-party domain registrar options.

Domain Forwarding Rules

If you set up domain forwarding rules at your domain registrar (such as GoDaddy, Namecheap, or Google Domains) while simultaneously enforcing canonical URL redirects on your web server, the two systems can conflict.
For example, if your domain registrar is set to forward example.com to [www.example.com](https://www.example.com), but your WordPress site or .htaccess file is set to redirect [www.example.com](https://www.example.com) back to example.com, an infinite loop occurs. Ensure domain forwarding is disabled at the registrar level if your web server handles canonical domain routing.

Summary Checklist for Resolving Redirect Errors

When troubleshooting the “Too Many Redirects” error in WordPress, work through this step-by-step checklist sequentially:
  1. Clear Browser Data: Delete domain cookies and browser cache, or test in an Incognito window.
  2. Check WordPress URLs: Verify that siteurl and home values match perfectly in WordPress settings, wp-config.php, or the database.
  3. Inspect SSL/TLS Settings: Ensure your CDN SSL mode is set to Full/Full (strict) rather than Flexible SSL, and configure proxy headers if needed.
  4. Reset .htaccess File: Rename .htaccess to disable corrupted rewrite rules and regenerate standard WordPress rules.
  5. Deactivate Plugins: Rename the wp-content/plugins folder via FTP to identify conflicting redirection or security plugins.
  6. Purge Server and CDN Caches: Flush server-side caches, CDN edge caches, and plugin caches.
  7. Verify Server Rules: Review Nginx or Apache config files for conflicting server-level rewrite directives.
By following these systematic troubleshooting steps, you can quickly identify the root cause of the “Too Many Redirects” error, restore your site’s functionality, and ensure seamless user navigation across your WordPress web application.

Leave a Reply

Your email address will not be published. Required fields are marked *

Read More!