How to Fix the ERR_TOO_MANY_REDIRECTS Error (Apache + Nginx Guide)
The ERR_TOO_MANY_REDIRECTS error occurs when a website keeps redirecting between URLs endlessly, creating a loop that the browser can’t escape. It's a common issue for websites using WordPress, CMS platforms, reverse proxies, or SSL configurations — especially with Apache or Nginx servers.
This guide covers everything you need to diagnose and fix the issue — whether you're using Apache or Nginx, Cloudflare, or a CMS like WordPress.
What Is ERR_TOO_MANY_REDIRECTS?
This error means your site is stuck in a redirection loop. The browser tried too many times to reach the final destination but never succeeded because it kept being redirected in a cycle.
Browser message example (Chrome):
This page isn’t working. example.com redirected you too many times.
ERR_TOO_MANY_REDIRECTS
Common Causes of Redirect Loops
- Conflicting redirect rules in
.htaccess
(Apache) ornginx.conf
- Improper HTTPS / SSL settings
- Mixed www vs non-www redirects
- Wrong CMS URL settings (WordPress, Joomla, etc.)
- Plugins (especially caching or redirection plugins)
- CDN conflicts, e.g., Cloudflare Flexible SSL
- Server-level redirections from control panels like cPanel or Plesk
Step-by-Step Fixes
Clear Browser Cookies and Cache
Sometimes the issue is client-side.
- Clear your browser’s cookies and cache
- Try accessing the site in Incognito Mode
- Or test from another browser/device
Check Redirect Chains
Use online tools to inspect redirect behavior:
You’ll be able to detect loops like:
https://example.com → http://www.example.com → https://example.com
(infinite)
Fix Redirect Rules (Apache / Nginx)
Apache (.htaccess):
Check your .htaccess
file (usually in the web root). Look for multiple or conflicting redirect rules.
Force HTTPS in Apache:
Force non-www (apache):
Force www (apache):
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Nginx (nginx.conf or site config):
Locate your Nginx config, often found at:
/etc/nginx/nginx.conf
/etc/nginx/sites-enabled/default
-
or custom paths
Force HTTPS in Nginx:
Force www (nginx):
Force non-www (nginx):
⚠️ Important: Only use one redirect rule. Do not redirect both www → non-www and non-www → www.
After changes:
WordPress URL Mismatches
Login to /wp-admin
, go to:
Settings > General
Ensure the URLs are consistent:
-
WordPress Address (URL)
-
Site Address (URL)
Both should be either:
-
https://example.com
-
or
https://www.example.com
If You Can’t Access the Admin:
Edit wp-config.php
:
Disable WordPress Plugins
Plugins — especially for SEO, caching, redirection, or security — can cause redirect loops.
How to Disable All Plugins:
If you can’t access the admin dashboard:
- Rename the
wp-content/plugins/
directory toplugins_backup
- Reload your site
Re-enable plugins one-by-one to find the culprit.
Fix CDN / Cloudflare Redirect Loops
If you’re using Cloudflare or another CDN, the issue might be in SSL mode.
For Cloudflare Users:
- Go to the SSL/TLS tab
- Set SSL mode to:
Full
(recommended)- Not
Flexible
(causes loops if origin has SSL)
Check for Hosting-Level Redirects
If you’ve added redirects via:
- cPanel
- Plesk
- Hosting dashboard
These might conflict with your CMS or server config. Remove or adjust as needed.
Reset .htaccess or Nginx Config (if needed)
Reset .htaccess
in WordPress:
Nginx Example Basic WordPress Block:
Always back up files before changes:
Emphasize your Creative Expertise
-
Mastering Web Hosting
This ultimate guide provides knowledge to make informed decisions, helping your website operate efficiently, securely, and smoothly
-
Beware of Typosquatting
A major threat businesses face is typosquatting—deceptive domains tricking users, stealing trust, and damaging brand reputations
-
The Importance of Using Secure Passwords
Cybercrime is increasing, with attackers often exploiting weakly protected accounts as the easiest entry point to systems