Fix “too many HTTP redirects” by finding the first wrong hop, then checking whether it is a 301 or a 302. A 301 says, “This move is permanent.” A 302 says, “Use this other URL for now.” When either one points back to an earlier URL, sends users through mixed HTTP and HTTPS rules, or clashes with a CDN, you get a redirect loop.
TLDR: A 301 redirect is usually cached harder by browsers and search engines, so a bad one can keep causing pain even after you think you fixed it. A 302 redirect is temporary, but it can still create loops when login rules, geolocation, or A/B tests disagree. For example, a site that sends http://example.com to https://www.example.com, then sends www back to non www, can produce 5, 10, or 20 hops before Chrome gives up. In one real analytics pattern, fixing a redirect loop on checkout pages can recover 8% to 15% of lost sessions within a day.
Why too many redirects happen
A redirect is not bad by itself. It is a normal way to move traffic from one URL to another. Problems start when rules pile up in different places. Your web server has one rule. Your CMS has another. Your CDN adds one more. Then a plugin tries to be helpful and ruins the morning.
Browsers usually stop after a certain number of redirects. Chrome often shows ERR_TOO_MANY_REDIRECTS. Firefox may say the page is not redirecting properly. Search crawlers also quit when the chain gets silly. That means users leave, bots waste crawl time, and analytics becomes noisy.
301 vs 302: the practical difference
The status code matters because it tells clients how to remember the redirect.
- 301 Moved Permanently: The URL has moved for good. Browsers may cache it. Search engines usually transfer ranking signals to the new URL over time.
- 302 Found: The move is temporary. The original URL should remain valid. Search engines are more cautious about treating the target as the final home.
This difference is huge when diagnosing redirect problems. A bad 301 can stick around in a browser cache and make you think the server is still broken. It drives me crazy that a single cached 301 can waste 20 minutes unless you test in a clean session or with command line tools.
A bad 302 is easier to change, but it can hide deeper logic problems. For example, a 302 might send logged out visitors to /login. Then the login page might detect a cookie problem and send them back to the original page. Round and round it goes.
Common redirect loops
Most loops are not mysterious. They usually come from one of these patterns:
- HTTP to HTTPS conflict: The server sends HTTP to HTTPS, while a proxy sends HTTPS back to HTTP.
- www vs non www fight: One tool prefers www. Another removes it.
- Trailing slash mismatch: /page redirects to /page/, while another rule reverses it.
- CMS plugin overlap: SEO, security, cache, and multilingual plugins all try to control URLs.
- Login and cookie loops: The app thinks the user is not authenticated, but the browser keeps receiving or losing session cookies.
- CDN SSL mode errors: A CDN talks to the origin over HTTP while users are forced to HTTPS.
- Geo or device redirects: Mobile, country, or language rules send visitors to pages that bounce them back.
How to diagnose the redirect chain
Start with the exact URL that fails. Do not guess. Copy it from the browser bar, including http or https, www or non www, path, slash, and query string.
Then inspect the redirect chain. You can use browser developer tools, an online header checker, or terminal commands. The command below is a reliable first test:
curl -I -L https://example.com/page
The -I flag asks for headers. The -L flag follows redirects. Watch each Location header and each status code. You are looking for repeated URLs, reversed rules, or a jump that makes no sense.
If you want more detail, use:
curl -v -L https://example.com/page
Expect to waste time on cached results if you only test in your normal browser. Use a private window, clear site data, or test with curl. If a 301 was cached, your browser may skip the request and jump straight to the old target.
Read the chain like a detective
A redirect chain might look like this:
http://example.com
301 → https://example.com
301 → https://www.example.com
302 → https://example.com
That final 302 is the problem. The visitor reaches www, then gets sent back to non www. Earlier, non www was told to become www. That is a loop.
Now ask a simple question: Which URL should be canonical? Pick one final home. For example:
https://www.example.com
Every variant should point there once. Not twice. Not through a scenic route. Just once.
When to use 301
Use a 301 when the move is permanent and intentional. Good cases include:
- Changing from HTTP to HTTPS.
- Choosing either www or non www.
- Renaming a page permanently.
- Merging duplicate content.
- Moving an old domain to a new domain.
Be careful. Because 301s can be cached, test them before pushing rules across the whole site. A bad global 301 can affect thousands of URLs in seconds. That is not fun to explain during a traffic drop.
When to use 302
Use a 302 when the redirect is temporary. Good cases include:
- Short promotions.
- A/B tests.
- Temporary maintenance pages.
- Location based routing that may change.
- Login redirects that depend on session state.
A 302 should not be used as a lazy replacement for a 301. If a page has moved forever, call it permanent. Search engines may eventually treat a long running 302 as permanent, but relying on that is messy. Use the right code from the start.
Server, CDN, and app layers
Redirects can happen in many places. Check them in this order:
- CDN or edge rules: SSL settings, page rules, worker scripts, country routing.
- Web server config: Apache .htaccess, Nginx server blocks, IIS rules.
- Application code: Framework routing, middleware, authentication checks.
- CMS settings: Site URL, home URL, permalink structure.
- Plugins: SEO, cache, redirect managers, security tools.
The annoying part is that each layer may look correct alone. The loop appears only when requests pass through all of them. That is why header tracing is better than clicking around and hoping.
SEO impact of redirect problems
Search engines can follow redirects, but they dislike waste. A clean single 301 is fine. A chain of five hops is weak. A loop is a dead end.
Too many redirects can cause:
- Lost crawl budget on large sites.
- Delayed indexing of new URLs.
- Ranking signals split between variants.
- Soft error reports in search tools.
- Lower conversion rates from broken landing pages.
For ecommerce sites, the damage can be direct. If 12% of mobile visitors hit a checkout redirect loop, paid campaigns keep spending while orders disappear. That is why redirect testing belongs in release checks, not just emergency debugging.
Fast checklist for fixing the issue
- Test the failing URL with curl or a header checker.
- Write down every hop and status code.
- Find the first URL that repeats or reverses direction.
- Choose one canonical final URL.
- Use 301 only for permanent moves.
- Use 302 only for temporary behavior.
- Clear browser cache or test in a fresh session.
- Disable plugins or rules one at a time if needed.
- Retest HTTP, HTTPS, www, non www, slash, and no slash versions.
- Check analytics after deployment for bounce rate and conversion recovery.
A redirect problem is rarely fixed by adding one more redirect. That often makes the knot tighter. The clean fix is to remove conflict, shorten the chain, and make every alternate URL point to one final destination with the right status code.
Use 301 for permanent decisions. Use 302 for temporary choices. When the browser says too many redirects, stop clicking refresh and inspect the chain. The answer is almost always sitting in the headers, quietly causing trouble.
