Too Many Redirects error: What it means and how to fix


Updated on Apr 19, 2025
· 11 mins read
troubleshooting http redirects web development error fixing

If you’ve ever encountered a frustrating error message stating Too Many Redirects ERR_TOO_MANY_REDIRECTS or This page has a redirect loop, you’re dealing with a common but troublesome web browsing issue. This comprehensive guide will help you understand what causes this error and provide practical solutions to fix it.

What Happens in a Redirect Loop?

A redirect loop occurs when a web server keeps sending your browser back and forth between URLs with no resolution. Here’s exactly what happens:

  1. Your browser sends a request to a URL (e.g., /blog)
  2. The server responds with a 302 redirect to another URL (e.g., /blog/new)
  3. Your browser follows this redirect and requests the new URL
  4. The server then redirects back to the original URL
  5. This cycle repeats, creating an endless loop

After approximately 20 redirects, your browser detects this infinite pattern and breaks the cycle, displaying the ERR_TOO_MANY_REDIRECTS error to prevent your browser from being trapped in an endless loop.

too many redirect sequence diagram

Summary

  1. What is the Too Many Redirects Error?
    This error occurs when a web page is caught in an endless redirection loop between different URLs with no final destination.

    • Different Browser Messages: Chrome shows ERR_TOO_MANY_REDIRECTS, Firefox displays “The page isn’t redirecting properly”, Safari shows Too many redirects occurred.
    • Root Cause: Your browser detects a circular redirection pattern and stops the process to prevent an infinite loop.
  2. Common Causes:

    • For Website Visitors: Corrupted cookies, browser extensions interfering with site redirects, or outdated cached data.
    • For Website Owners: Misconfigured redirect rules, conflicting plugins (especially in WordPress), incorrect SSL/HTTPS configuration, or load balancer/CDN issues.
  3. How to Fix It?

    • For Website Visitors:

      • Clear browser cookies and cache: Instructions for all browsers.
      • Try incognito/private browsing mode.
      • Temporarily disable browser extensions.
      • Try a different browser or device.
      • Check your system’s time and date settings.
    • For Website Owners:

      • Check and fix redirect rules in server configuration files (.htaccess, nginx.conf).
      • Resolve plugin conflicts by deactivating plugins one by one.
      • Verify SSL/HTTPS configuration and certificate installation.
      • Check CMS URL settings (WordPress site URL settings, etc.).
      • Review load balancer and CDN configurations.
      • Implement logging to diagnose complex redirect patterns.
      • Detailed solutions for Apache, Nginx, and WordPress.
too many redirects flowchart

What is a “Too Many Redirects” Error?

A Too Many Redirects error occurs when a web page gets caught in an endless redirection loop. Instead of landing on your desired webpage, your browser detects that it’s being sent in circles between different URLs with no final destination.

Different browsers display this error in various ways:

  • Chrome: ERR_TOO_MANY_REDIRECTS or This webpage has a redirect loop
  • Firefox: The page isn't redirecting properly
  • Safari: Too many redirects occurred trying to open [URL]
  • Edge: This page isn't working right now

Regardless of the wording, the core issue remains the same: your browser has detected a circular redirection pattern and stopped the process to prevent an infinite loop.

Common Causes of Redirect Loops

1. Incorrect Redirect Rules

One of the most common causes is misconfigured redirect rules in your website’s configuration files, such as .htaccess for Apache servers or nginx.conf for Nginx servers. For example:

  • Redirecting URL A to URL B, while URL B redirects back to URL A
  • Redirecting all HTTP requests to HTTPS, but misconfiguring the HTTPS endpoint to redirect back to HTTP
  • Creating a chain of redirects that eventually loops back to an earlier URL in the chain

2. Conflicting Plugins or Extensions

If you’re using a content management system (CMS) like WordPress, conflicting plugins that handle URL redirects can create redirection loops. This often happens when:

  • Multiple SEO plugins try to enforce canonical URLs or HTTPS
  • Caching plugins conflict with security plugins
  • Redirection plugins have overlapping or contradictory rules

3. Incorrect SSL/HTTPS Configuration

When implementing SSL certificates and HTTPS, improper configuration can lead to redirect loops, especially if:

  • Your website forces HTTPS but your SSL certificate isn’t properly installed
  • Mixed content rules are improperly handled
  • Load balancers or CDNs have conflicting SSL settings
  • Using free SSL providers like Let's Encrypt requires proper configuration to avoid redirection issues

Sometimes cookies can cause redirect loops, particularly when:

  • Authentication cookies are corrupted or improperly set
  • Session management has flaws in the redirection logic
  • Geolocation or language preference cookies create circular redirections

How to Diagnose Redirect Loop Issues

Before implementing solutions, it’s important to identify the exact cause of your redirect loop:

1. Use Browser Developer Tools

Open your browser’s developer tools (F12 or right-click and select “Inspect”), navigate to the Network tab, and attempt to access the problematic URL. Look for a pattern of 301 or 302 HTTP status codes that form a loop.

301 error logs

2. Check Server Logs

Examine your web server’s access and error logs to trace the redirection path. Look for patterns of repeated redirects between the same set of URLs.

3. Test in Multiple Browsers and Devices

Determine if the issue is browser-specific or affects all users by testing in different browsers, devices, and network environments.

4. Use Redirect Checkers

Online tools like httpstatus.io or HTTP Status Checker can help visualize redirect chains and identify where loops occur.

devtoollab http status checker

How to Fix Too Many Redirects Errors

For Website Visitors

If you’re encountering this error while browsing a website:

1. Clear Browser Cookies and Cache

This is often the simplest solution, as corrupted cookies are a common cause:

  • Chrome: Settings → Privacy and security → Clear browsing data
Clear Browser Cache and Cookies

For Other Browser

  • Firefox: Options → Privacy & Security → Cookies and Site Data → Clear Data
  • Safari: Preferences → Privacy → Manage Website Data → Remove All
  • Edge: Settings → Privacy, search, and services → Clear browsing data

2. Try Incognito/Private Browsing

Open the problematic website in an incognito or private browsing window to check if the issue is related to your browser profile.

Url Check ScreenShot

3. Disable Browser Extensions

Temporarily disable browser extensions, especially those related to security, ad-blocking, or content modification, as they might interfere with website redirections.

browser extensions

4. Try a Different Browser

If the error persists, try accessing the website from a different browser to determine if it’s a browser-specific issue.

5. Check Time and Date Settings

Ensure your device’s time and date settings are correct, as authentication systems sometimes use these for cookie validation.

For Website Owners and Administrators

If you’re experiencing this error on your own website, here’s a comprehensive approach to resolving the issue:

1. Check and Fix Redirect Rules

Misconfigured redirect rules are the most common cause of redirect loops. Examine your website’s configuration files carefully:

  • For Apache (.htaccess):

    • Look for conflicting Redirect, RedirectMatch, or RewriteRule directives
    • Check for rules that might create circular paths
    • Ensure proper rule ordering (rules are processed sequentially)
    • Example of a problematic rule pair:
      RewriteRule ^support$ /help [R=301,L]
      RewriteRule ^help$ /support [R=301,L]
      
  • For Nginx:

    • Review location blocks with return or rewrite directives
    • Check for overlapping location blocks with conflicting rules
    • Ensure proper handling of the X-Forwarded-Proto header
    • Example of a corrected HTTPS redirect:
      # Safe way to redirect HTTP to HTTPS
      server {
          listen 80;
          server_name example.com;
      
          location / {
              # Only redirect if not already on HTTPS
              if ($http_x_forwarded_proto != "https") {
                  return 301 https://$host$request_uri;
              }
          }
      }
      
  • For IIS:

    • Examine URL Rewrite rules in your web.config file
    • Look for rules with conditions that might create cycles
    • Check for conflicts between global and location-specific rules
    • Use the IIS URL Rewrite trace tool to debug complex redirects

2. Resolve Plugin Conflicts

Plugin conflicts are especially common in WordPress and other CMS platforms:

  • Systematic debugging approach:

    1. Create a backup of your site
    2. Temporarily deactivate all plugins
    3. Check if the redirect loop is resolved
    4. Reactivate plugins one by one, testing after each activation
    5. Once you identify the problematic plugin, check its settings or contact the developer
  • Common problematic plugin combinations:

    • Multiple SEO plugins (Yoast SEO, Rank Math, All-in-One SEO)
    • Caching plugins (WP Rocket, W3 Total Cache) with security plugins (Wordfence, Sucuri)
    • Redirection plugins with multilingual plugins
    • CDN integration plugins with SSL plugins
  • Specific plugin settings to check:

    • Force HTTPS options in multiple plugins
    • Canonical URL settings
    • Redirect settings for www vs. non-www versions
    • Cookie-based redirect settings for country/language detection

3. Fix SSL/HTTPS Configuration

SSL misconfiguration is a frequent source of redirect loops:

  • Verify certificate installation:

    • Ensure your SSL certificate is valid and properly installed
    • Check certificate chain issues using tools like SSL Labs
    • Verify that intermediate certificates are properly included
    • Look for domain name mismatches between certificate and site URL
  • Resolve mixed content issues:

    • Scan your site for HTTP resources on HTTPS pages
    • Update hardcoded HTTP links in your code
    • Use Content-Security-Policy headers to detect mixed content
    • Example tool command:
      grep -r "http://" --include="*.php" --include="*.html" /path/to/your/website
      
  • Check load balancer configuration:

    • Ensure proper SSL termination settings
    • Verify that HTTP headers are correctly forwarded
    • Check for protocol-specific redirects that might conflict
    • Example of a correct load balancer configuration check:
      curl -I https://pinggy.io -H "X-Forwarded-Proto: https"
      

4. Check CMS Settings

Many content management systems have built-in settings that can cause redirect loops:

  • WordPress:

    • Verify that both “WordPress Address (URL)” and “Site Address (URL)” in Settings → General match exactly
    • Check the WP_HOME and WP_SITEURL constants in wp-config.php
    • Examine the wp_options table for inconsistent URL values
    • Example wp-config.php fix:
      define('WP_HOME', 'https://example.com');
      define('WP_SITEURL', 'https://example.com');
      
  • Drupal:

    • Check the base URL settings in settings.php
    • Verify clean URL configuration
    • Review the trusted host patterns setting
    • Example settings.php fix:
      $settings['trusted_host_patterns'] = [
        '^example\.com$',
        '^www\.example\.com$',
      ];
      
  • Joomla:

    • Verify SEO settings in Global Configuration
    • Check redirect plugin settings
    • Review .htaccess rules generated by Joomla
    • Make necessary adjustments to the configuration.php file

5. Review Load Balancer and CDN Settings

Modern hosting architectures with CDNs and load balancers introduce additional complexity:

  • Cloudflare configuration:

    • Check Page Rules for conflicting redirect rules
    • Verify SSL/TLS mode (Flexible, Full, Full Strict)
    • Review Always Use HTTPS setting interaction with server configuration
    • Examine Cloudflare’s crawler hints settings
  • AWS Configuration:

    • Check Application Load Balancer listener rules
    • Verify proper forwarding of the X-Forwarded-Proto header
    • Review S3 redirect rules if using S3 for static hosting
    • Example ALB configuration check:
      aws elbv2 describe-rules --listener-arn your-listener-arn
      
  • Custom proxy setups:

    • Check for redirect loops between proxy layers
    • Verify correct header forwarding
    • Ensure consistent SSL handling across all layers
    • Example Nginx proxy fix:
      proxy_set_header X-Forwarded-Proto $scheme;
      

6. Implement Proper Logging and Monitoring

Set up detailed logging to diagnose complex redirect issues:

  • HTTP request logging:

    • Configure detailed access logs with redirect chain information
    • Use log analyzers to identify patterns
    • Track referer headers to understand redirect sources
    • Example Apache log format:
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
      
  • Application-level logging:

    • Add temporary debug code in your application to log redirect decisions
    • Track session and cookie values that might influence redirects
    • Log conditional logic outcomes related to URL determination
    • Example PHP debugging code:
      error_log(sprintf(
          "Redirect triggered: From %s to %s (User Agent: %s, Referrer: %s)",
          $_SERVER['REQUEST_URI'],
          $redirectUrl,
          $_SERVER['HTTP_USER_AGENT'],
          $_SERVER['HTTP_REFERER'] ?? 'none'
      ));
      

By systematically working through these detailed steps, you’ll be able to identify and resolve even the most complex redirect loop issues on your website. Remember to test each change thoroughly and to keep a backup of your original configuration in case you need to revert changes.

Advanced Troubleshooting Techniques

Using cURL to Diagnose Redirects

The command-line tool cURL can help identify redirect chains:

curl -IL https://pinggy.io
curl terminal

This will show all redirect hops with their status codes and headers.

Analyzing with Network Monitoring Tools

Tools like Wireshark or Fiddler can provide detailed insights into HTTP traffic, helping identify complex redirect patterns.

Server-Side Debugging

Implementing temporary logging in your server-side code can help track the logic that triggers redirects:

// PHP example
error_log('Redirect triggered from: ' . $_SERVER['REQUEST_URI'] . ' to: ' . $destination);

Preventing Redirect Loops in the Future

Best Practices for Implementing Redirects

  1. Test thoroughly before deploying: Use staging environments to test redirect rules before applying them to production.

  2. Implement redirect limits: Configure your application to limit the number of consecutive redirects.

  3. Document your redirect strategy: Maintain clear documentation of all redirect rules and their purposes.

  4. Use monitoring tools: Implement tools that can alert you if redirect chains exceed a certain length.

  5. Regular audits: Periodically review your website’s redirect rules to identify and eliminate unnecessary or problematic redirections.

Specific Solutions for Common Platforms

WordPress

// Add to wp-config.php to help diagnose redirect issues
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Check that your site URL settings in Settings → General are correct and consistent.

Apache Servers

# Proper way to redirect HTTP to HTTPS without causing loops
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Nginx Servers

# Proper HTTPS redirect for Nginx
server {
    listen 80;
    server_name example.com www.example.com;
    
    # Avoid loops by checking X-Forwarded-Proto
    if ($http_x_forwarded_proto != "https") {
        return 301 https://$host$request_uri;
    }
    
    # Rest of your configuration
}

Conclusion

The Too Many Redirects error, while frustrating, is usually fixable once you understand its cause. By systematically checking your browser settings, website configuration, and redirection rules, you can identify and resolve the circular redirections causing the problem.

Remember that this error is ultimately a safety mechanism—your browser is protecting you from an infinite loop that would otherwise crash your browsing session. With the troubleshooting steps outlined in this guide, you should be able to diagnose and fix redirect loops, whether you’re a website visitor or administrator.

If you continue to experience issues after trying these solutions, consider reaching out to your website host’s support team or consulting with a web developer who specializes in server configurations and redirects.