UnderHost
Knowledgebase Docs

Redirect loop error-fix infinite redirects

Fix "too many redirects" or "redirect loop" caused by misconfigured .htaccess, HTTPS, or plugin conflicts.

On this page

A redirect loop occurs when Site A redirects to Site B, which redirects back to Site A. The browser keeps redirecting infinitely and eventually gives up with "too many redirects" error.

.htaccess redirect conflicts

Multiple redirect rules in .htaccess can cause loops. Example:

Redirect 301 /page-a/ /page-b/
Redirect 301 /page-b/ /page-a/  # Oops! Redirects back to page-a

Fix: Check .htaccess for conflicting redirects. Each source URL should redirect to a different destination, never back to itself.

HTTPS redirect loops

Mixed HTTP/HTTPS redirects cause loops:

  • WordPress settings → General: Make sure Home and Site URL both use https:// OR both use http://
  • .htaccess forcing HTTPS while WordPress forces HTTP (or vice versa)
  • CloudFlare SSL setting set to "Flexible" while site forces HTTPS

Fix: Ensure all redirects target the same protocol (always HTTPS on modern sites).

WordPress plugin conflicts

A caching plugin or security plugin may cache a redirect and serve it for all URLs.

Fix:

  1. Clear all caches: Settings → Clear Cache (or delete /wp-content/cache/)
  2. Disable all plugins: Rename /wp-content/plugins/ to /wp-content/plugins-old
  3. Test your site - if loop stops, a plugin caused it
  4. Re-enable plugins one-by-one to find which one

Diagnose and fix a redirect loop

  1. Clear browser cache: Ctrl+Shift+Delete, clear all cache
  2. Check WordPress settings: Settings → General - verify Home/Site URL are identical and use correct protocol
  3. Review .htaccess: Look for conflicting Redirect or RewriteCond rules
  4. Disable plugins: Rename plugins-old back to plugins and re-enable one-by-one
  5. Check CloudFlare: If using CloudFlare, temporarily disable it to test
  6. Check SSL: Verify HTTPS certificate is valid
Browser shows the chain

In browser Developer Tools (F12) → Network tab, you can see the redirect chain: what redirected to what. This helps identify the problematic redirect.

Related: 404 errors | SSL errors

Was this article helpful?

Still troubleshooting?

Use UnderHost tools for quick checks, or open a support ticket when the issue needs account or server access.

Related articles

Back to Troubleshooting