Technical SEO

What is a redirect loop and how do I fix it?

Learn what redirect loops are, why they occur, how to identify them, and the most effective methods to resolve them quickly.

By Inventive HQ Team

Understanding and Fixing Redirect Loops

A redirect loop is a chain of HTTP 3xx responses that never reaches a real page because it circles back on itself — URL A redirects to URL B, and B redirects back to A. The browser follows the chain, sees the same URL reappear, gives up after about 20 hops, and shows ERR_TOO_MANY_REDIRECTS. To fix it you find every hop in the chain, decide which single URL is the canonical destination, rewrite all the rules to point directly there, then delete the rule that pointed backward. Loops almost always come from two conflicting rules: HTTP-to-HTTPS fighting a CDN, a trailing slash being added and removed, www versus non-www, or a CMS whose configured site URL disagrees with the real domain.

That's the summary an AI Overview will give you. Here's what it can't show you — the exact shape of the cycle, a table that maps the error you're seeing to the rule that caused it, and a live tool to trace your own redirect chain so you can watch the loop close in real time.

How a redirect loop cycles between two URLs Page A returns a 301 redirect to Page B, and Page B returns a 301 redirect back to Page A, so a request packet travels around the circle forever and never reaches page content. The loop never reaches a 200 OK /page-a 301 → /page-b /page-b 301 → /page-a

Every hop is a valid redirect — the chain is just missing a final destination Result: ERR_TOO_MANY_REDIRECTS after ~20 hops

Trace your own redirect chain

Paste a URL below to follow every hop, see each status code and Location header, and spot the moment a URL repeats — that repetition is the loop.

Loading interactive tool...

Redirect loops are among the most frustrating issues to diagnose because the problem is often invisible until users encounter the broken page. Search engines see the issue as a crawl error, browsers display error messages, and website functionality deteriorates. However, with systematic debugging techniques, redirect loops can be identified quickly and fixed efficiently.

What Exactly Is a Redirect Loop?

Anatomy of a Redirect Loop

A simple redirect loop:

URL: example.com/page
Response: 302 Redirect to example.com/new-page
↓
URL: example.com/new-page
Response: 302 Redirect to example.com/page
↓
(Back to start - infinite cycle)

More complex loops involve multiple URLs:

example.com/page1 → example.com/page2 → example.com/page3 → example.com/page1

How Browsers Handle Loops

Browsers cap the number of redirects they will follow, then abort with an error. The limits are more consistent than folklore suggests:

Chrome / Edge / Brave (Chromium): Stop after 20 redirects (kMaxRedirects = 20) Firefox: Stops after 20 redirects (the network.http.redirection-limit preference, default 20) Safari (WebKit): Stops at a low double-digit limit and reports "too many redirects" curl / wget (CLI): curl -L follows up to 50 hops by default, then prints "Maximum (50) redirects followed"

None of these limits imply the chain is fine at hop 19 — anything beyond two or three hops already hurts speed and SEO. The limit is just where the browser gives up.

When the browser detects a loop, users see an error message:

  • Chrome: "ERR_TOO_MANY_REDIRECTS"
  • Firefox: "The page isn't redirecting properly"
  • Safari: "Too many redirects"

These error messages mean the page is completely unreachable to the user.

How Search Engines Handle Loops

Search engines handle redirect loops by:

  1. Detecting the Loop: After following several redirects to the same URL, they recognize the pattern
  2. Stopping Crawl: They stop following the redirect chain
  3. Recording Error: The page is recorded as having a crawl error
  4. Skipping Indexation: The page (and all pages in the loop) are not indexed
  5. Reporting in Search Console: You see crawl errors in Google Search Console

The result: pages caught in redirect loops disappear from search results.

Why Redirect Loops Occur

Misconfigured Redirect Rules

Scenario: You want to redirect /old to /new but accidentally set up bidirectional redirects:

/old → /new  (intentional)
/new → /old  (accidental configuration)

This happens when redirect configuration systems allow creating rules without checking for logical consistency.

Case-Sensitivity Issues

Scenario: Your server treats URLs case-sensitively:

/Products → /products (redirect for consistency)
/products → /Products (another rule for different reason)
Result: Loop between /Products and /products

Different operating systems and servers handle case sensitivity differently:

  • Linux/Unix: Case-sensitive (PRODUCTS ≠ products)
  • Windows: Case-insensitive (PRODUCTS = products)

Migrating between systems without accounting for this creates loops.

Trailing Slash Redirects

Scenario: One rule removes trailing slashes, another adds them:

/page/ → /page (remove trailing slash)
/page → /page/ (add trailing slash)
Result: Infinite loop between /page and /page/

Parameter Handling Issues

Scenario: Redirects based on URL parameters that are being rewritten:

User requests: /product?id=123
Server adds: ?utm_source=search
Result: Redirect rule matches again, adding another parameter
Infinite loop of parameter additions

Domain Redirect Conflicts

Scenario: Multiple domain redirects point to each other:

example.com → exampletest.com (redirect rule)
exampletest.com → example.com (backup redirect rule)
Result: Infinite loop between domains

Application-Level Redirects

Scenario: Your application or CMS performs redirects based on certain conditions:

User visits /admin
Application redirects non-authenticated users to /login
/login has logic that redirects back to /admin
Infinite loop for unauthenticated users

Identifying Redirect Loops

Browser Testing

Manual Method:

  1. Open the browser's Developer Tools (F12)
  2. Navigate to the problematic URL
  3. Watch the Network tab as requests occur
  4. Observe the redirect chain until the browser stops
  5. The error message appears

What to Look For:

  • "ERR_TOO_MANY_REDIRECTS" or equivalent error
  • Multiple requests to similar URLs in quick succession
  • No final response with actual page content

Browser Extension Tools

Redirect Tracers:

  • "Redirect Path" (Chrome): Shows complete redirect chain
  • "Redirects Viewer" (Firefox): Detailed redirect information
  • "Redirect Checker" (various): Identifies redirect issues

These extensions show the complete chain visually, making the loop obvious.

Advertisement

Command-Line Tools

Using curl (shows response headers):

curl -i -L https://example.com/page

The -L flag follows redirects. If a loop exists, curl will eventually timeout or show repeated requests.

Using wget:

wget --max-redirect=5 https://example.com/page

This limits redirects to 5 hops, preventing infinite requests. If the page fails with 5 hops, likely a loop.

Google Search Console

Crawl Errors Report:

  1. Go to Google Search Console
  2. Navigate to Coverage or Crawl Errors
  3. Look for "Redirect" or "Crawl" errors
  4. Click error to see affected URLs
  5. Often indicates which URLs are looping

Search Results Tab:

  • Pages caught in loops won't appear in search results
  • If pages suddenly disappear from search, investigate redirects

Online Redirect Checkers

Services like:

  • Redirect Checker Tools: Input URL and get complete redirect chain
  • SEO Tools: Moz, Semrush, Ahrefs all show redirect information
  • httpstatus.io: Shows response codes and redirect paths

Symptom → Cause → Fix Quick Reference

Before diving into the step-by-step process, match what you're seeing to its most likely cause. This table covers the loops that account for the overwhelming majority of real-world cases.

Symptom you observeMost likely causeFastest fix
ERR_TOO_MANY_REDIRECTS, page loads over HTTPS then failsOrigin redirects HTTP→HTTPS while CDN/proxy forwards plain HTTP backRedirect to HTTPS in one place only (the edge); make origin trust X-Forwarded-Proto
URL flickers between /page and /page/ in the Network tabTrailing-slash rule and no-trailing-slash rule both activeKeep exactly one canonical form; delete the opposing rule
Loop between www and non-wwwTwo host redirects pointing at each otherPick one canonical host; remove the reverse rule
Loop only for logged-out users on /admin, /accountAuth guard sends to /login, login sends back before session is setFix the auth condition so /login renders without redirecting
WordPress site loops on every page after an SSL change"WordPress Address" vs "Site Address" mismatch, or SSL plugin vs proxyAlign both URLs in Settings → General; disable the SSL/redirect plugin
Loop appears only on certain paths after a migrationCase-sensitivity mismatch (/Products vs /products) on a Linux originStandardize to lowercase; keep a single one-way rule
Fixed the rule but the loop persistsCached 301 in browser or CDNPurge CDN, hard-refresh in a private window, restart the server

How to Fix Redirect Loops

Step 1: Identify the Exact Loop

Before fixing, you must understand exactly which URLs are involved:

Create a Redirect Map:

Document each URL and where it redirects:
/page1 → /page2
/page2 → /page3
/page3 → /page1  ← Loop detected!

Use browser tools, curl, or online checkers to build this map.

Step 2: Determine the Intended Destination

Decide where users should ultimately end up:

Questions:

  • What is the canonical/final URL?
  • Which URL contains the actual content?
  • Which URL should be in search results?
  • What was the original intention?

Example:

Loop identified: /old → /new → /final → /old
Intended destination: /final (the content is here)
Solution: Update all rules to go directly to /final

Step 3: Break the Loop

Update redirect rules to point directly to the final destination:

Before:

.htaccess or nginx config:
/old → /new
/new → /final
/final → /old (the problem!)

After:

/old → /final
/new → /final
/final → (no redirect, this is the canonical URL)

Step 4: Test the Fix

Verify Each URL:

curl -i -L https://example.com/old
curl -i -L https://example.com/new
curl -i -L https://example.com/final

All should eventually reach /final without loops.

Browser Testing:

  • Visit each URL in browser
  • Verify you reach the correct page
  • No error message should appear
  • Page should load normally

Step 5: Monitor Search Console

After Fixing:

  1. Submit sitemap to Google Search Console
  2. Monitor crawl errors (should decrease)
  3. Check coverage to verify proper indexing
  4. Monitor search rankings
  5. Expect 1-2 weeks for full recovery

Common Redirect Loop Scenarios and Solutions

Scenario: Case Sensitivity Loop

Problem:

/Products → /products (Linux server, case-sensitive)
/products → /Products (another rule)
Loop!

Solution: Standardize to one case throughout:

/Products → /products (only rule)
/products → (no redirect, canonical URL)

Prevention: Use lowercase URLs consistently across entire site.

Scenario: Trailing Slash Loop

Problem:

/page/ → /page (remove trailing slash)
/page → /page/ (add trailing slash)

Solution: Pick one standard:

Option A - Always use trailing slash:

/page → /page/ (only rule)

Option B - Never use trailing slash:

/page/ → /page (only rule)

Prevention: Use URL rewrite rules consistently for all pages.

Scenario: www vs Non-www Loop

Problem:

www.example.com → example.com
example.com → www.example.com

Solution: Pick one canonical:

Option A - Use www:

example.com → www.example.com (only rule)

Option B - No www:

www.example.com → example.com (only rule)

Scenario: Domain Migration Loop

Problem:

old-domain.com → new-domain.com
new-domain.com → old-domain.com (backup redirect)

Solution: Remove bidirectional redirects:

old-domain.com → new-domain.com (only rule)
new-domain.com → (no redirect, canonical)

Preventing Redirect Loops

Best Practices

1. Centralized Redirect Management:

  • Maintain a single source of truth for redirects
  • Use one configuration file or system
  • Avoid multiple tools creating conflicting rules

2. Testing Before Deployment:

  • Test all redirect chains before going live
  • Use redirect checkers to verify no loops exist
  • Document the intended chain

3. Regular Audits:

  • Quarterly review of all active redirects
  • Use Screaming Frog or similar to audit entire site
  • Remove obsolete redirects

4. Logical Review:

  • Before creating a redirect, think through the chain
  • Ask: "Where will this ultimately lead?"
  • Verify the destination has no redirects pointing back

5. Version Control:

  • Keep .htaccess and redirect configs in version control
  • Track changes and reasons
  • Easy rollback if issues occur

6. Monitoring:

  • Set up alerts for crawl errors in Search Console
  • Monitor "too many redirects" errors
  • Track 3xx response codes in server logs

Tools for Prevention and Detection

Screaming Frog SEO Spider: Desktop crawler that identifies redirect chains and loops

Google Search Console: Built-in crawl error reporting

SEMrush, Ahrefs, Moz: All include redirect auditing tools

Redirect Tester Browser Extensions: Show redirect chains in real-time

Custom Monitoring Scripts: Automated checks of critical URL redirects

Troubleshooting Persistent Loop Issues

If the Loop Still Exists After Fixes:

  1. Clear Caches:

    • Clear browser cache
    • Clear CDN caches
    • Restart web server
    • Cached redirect rules may override new ones
  2. Check All Redirect Sources:

    • .htaccess file (if using Apache)
    • nginx.conf (if using Nginx)
    • Web server configuration
    • Application-level redirects (CMS, custom code)
    • CDN redirect rules
    • Firewall/WAF rules
  3. Verify File Upload:

    • Confirm new .htaccess is actually uploaded
    • Check file permissions
    • Verify syntax is correct
  4. Restart Services:

    • Restart web server
    • Restart application
    • Restart caching layer
    • May need service restart to load new config
  5. Check Application Logic:

    • If using CMS, check for redirect plugins
    • Search code for redirect() functions
    • Verify no conflicting logic

Conclusion

Redirect loops are serious issues that completely break page accessibility and search visibility. However, they're also straightforward to diagnose and fix once you understand how to trace the redirect chain. By systematically identifying the loop, determining the correct destination, updating redirect rules to point directly there, and testing thoroughly, you can resolve redirect loops quickly. Implementing best practices like centralized redirect management, thorough testing before deployment, and regular audits prevents most redirect loops from occurring in the first place. When loops do occur, treating them as high-priority issues and addressing them promptly minimizes damage to user experience and SEO.

Frequently Asked Questions

What causes ERR_TOO_MANY_REDIRECTS?

ERR_TOO_MANY_REDIRECTS means the browser followed a chain of HTTP 3xx responses that never resolved to a final 200 page and gave up. The usual culprits are bidirectional redirect rules (A points to B and B points back to A), a conflict between HTTPS and CDN redirects (the server redirects to HTTPS while a proxy in front rewrites back to HTTP), a trailing-slash rule fighting a no-trailing-slash rule, or a WordPress/CMS setting whose "site URL" disagrees with the actual domain.

How many redirects does a browser follow before it errors?

Chromium-based browsers (Chrome, Edge, Brave) stop after 20 redirects and show ERR_TOO_MANY_REDIRECTS. Firefox uses the same default of 20 (the network.http.redirection-limit preference). The command-line tool curl follows up to 50 hops with -L before printing "Maximum (50) redirects followed." None of these limits mean the chain is healthy at 19 hops; anything past 2-3 hops is already an SEO and performance problem.

How do I find which URLs are in the loop?

Run curl -sIL -o /dev/null -w "%{http_code} %{redirect_url}\n" https://example.com/page or paste the URL into a redirect-chain checker. Each line shows a status code and the next Location header, so the loop becomes visible the moment a URL you have already seen reappears. Build a redirect map of every hop before you change any rule.

Is a redirect loop bad for SEO?

Yes. A page trapped in a redirect loop never returns content, so search engines record a crawl error and drop the page (and every URL in the loop) from the index. Because loops waste crawl budget and hide content, Google treats them as harder failures than a single slow redirect. Pages usually recover within one to two weeks after the loop is broken and the URLs are recrawled.

What is the difference between a redirect loop and a redirect chain?

A redirect chain is a finite sequence that ends at a real page (A to B to C to 200 OK) - it works but wastes hops and hurts speed and SEO. A redirect loop never terminates because the chain circles back on itself (A to B to A), so no page ever loads. Every loop is a broken chain; not every chain is a loop.

Why does my WordPress site have a redirect loop?

The most common WordPress cause is a mismatch between the "WordPress Address" and "Site Address" settings, or an SSL/HTTPS plugin that forces HTTPS while the hosting proxy still reports HTTP - the two keep bouncing the request. Check wp-admin > Settings > General, disable redirect and caching plugins one at a time, and confirm your reverse proxy passes the correct X-Forwarded-Proto header.

How do I fix a trailing-slash redirect loop?

Pick one canonical form and enforce it with a single rule. Either always add the trailing slash or always remove it - never both. The loop happens because one rule strips the slash and another rule re-adds it, so the request oscillates forever between /page and /page/. Delete the conflicting rule and keep exactly one.

Can HTTP-to-HTTPS redirects cause a loop?

Yes, and it is one of the most common production loops. It happens when a load balancer or CDN terminates TLS and forwards plain HTTP to your origin, while the origin sees HTTP and redirects to HTTPS - which the CDN answers with HTTP again. Fix it by redirecting to HTTPS in only one place (the edge/CDN) and having the origin trust the X-Forwarded-Proto header instead of the raw connection scheme.

Do I need to clear my cache after fixing a redirect loop?

Almost always. Browsers aggressively cache 301 (permanent) redirects, and CDNs cache 3xx responses too, so the loop can persist even after you fix the server rule. Clear the CDN cache, purge or hard-refresh the browser (or test in a private window), and restart the web server so the new configuration is actually in effect before you conclude the fix failed.

redirectstroubleshootingtechnical issueserror handling