Web & Development

How to Fix Too Many Redirects on a Website: WordPress, Joomla, HTTPS and Cloudflare

How to Fix Too Many Redirects on a Website: WordPress, Joomla, HTTPS and Cloudflare

Getting ERR_TOO_MANY_REDIRECTS on your website? Learn how to find and fix redirect loops caused by HTTPS, Cloudflare, WordPress, Joomla, and .htaccess, using practical browser-based diagnostics.

You open your website after enabling HTTPS, changing its domain name, or updating a plugin. Instead of seeing the homepage, your browser displays:

`ERR_TOO_MANY_REDIRECTS`

Firefox may show a similar message: The page isn't redirecting properly.

The browser suggests clearing cookies. You try it, but the website still doesn't load.

The problem is often not the browser. Two or more components of your website may be repeatedly redirecting visitors between different addresses.

The good news is that you can diagnose most redirect loops using your browser, your hosting control panel, and the administration interface of WordPress, Joomla, or Cloudflare.

This guide explains how redirects work, how to identify the component causing the loop, and how to fix it without using a command line.

1. What causes ERR_TOO_MANY_REDIRECTS?

A redirect tells the browser to open another URL.

For example, when a visitor requests:

http://example.com/

Your server may redirect them to:

https://example.com/

That is normal.

The problem starts when another configuration redirects the visitor back to the original address.

Example: an HTTPS redirect loop

http://example.com
       ↓ redirects to HTTPS
https://example.com
       ↓ another rule redirects back to HTTP
http://example.com
       ↻ cycle repeats

The browser follows the redirects until it reaches its limit, then stops.

Other common redirect loops involve:

  • `www.example.com` versus `example.com`
  • Conflicting WordPress site addresses
  • Joomla HTTPS configuration
  • Cloudflare SSL/TLS settings
  • Hosting-panel redirects and `.htaccess` rules
  • Login, session, or authentication redirects

A redirect loop can also affect only one page, such as `/wp-admin/`, rather than the entire website.

2. Understand the HTTP redirect codes

Not all redirects mean the same thing.

Code Meaning Typical use
`301` Permanent redirect Moving a page permanently
`302` Temporary redirect Temporary URL change
`303` See Other Redirecting after form submission
`307` Temporary redirect preserving request method Temporary redirect for requests that must retain their method
`308` Permanent redirect preserving request method Permanent redirect retaining the method and body

For SEO, a permanent domain migration generally uses `301` or `308` redirects. But using a permanent redirect does not make a broken redirect chain correct.

A `301` from HTTP to HTTPS is fine. A `301` from HTTPS back to HTTP is not fine if the first rule remains active.

MDN documents the differences between these HTTP status codes and their effects on request methods.

3. Diagnose the problem before changing anything

The first mistake is changing several settings at once.

If you modify Cloudflare, WordPress, and `.htaccess` simultaneously, you may restore the website without understanding what caused the failure. The same problem could return later.

Instead, identify the redirect chain.

Step 3.1 — Test the four main URL variations

Open a private browser window and test:

http://example.com/
https://example.com/
http://www.example.com/
https://www.example.com/

Replace `example.com` with your domain.

Record which URLs work, fail, or redirect.

Result Possible explanation
Only HTTP fails HTTPS redirect configuration issue
Only HTTPS fails SSL/TLS or application configuration
Only `www` fails Hostname redirect or DNS configuration
All variations fail Server, CDN, or application-level conflict
Homepage works but login fails Authentication or session redirect

These are diagnostic clues, not definitive conclusions.

Step 3.2 — Inspect redirects with browser developer tools

Chrome, Edge, and Firefox provide built-in tools for examining network requests.

In Chrome or Edge:

  1. Open the affected website.
  2. Press `F12` or right-click the page and select Inspect.
  3. Open the Network tab.
  4. Enable Preserve log.
  5. Select the Doc filter if available, to focus on document requests.
  6. Enter the affected URL in the address bar and reload.
  7. Examine the requests shown in the Network panel.

Look for responses with status codes `301`, `302`, `307`, or `308`.

Click a request and inspect its Headers section.

The Location response header indicates where the server wants the browser to go next.

For example:

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/

Then examine the next request.

If it responds with:

HTTP/1.1 302 Found
Location: https://example.com/

And another rule sends the browser back to `www`, you've found the loop.

Example redirect chain

Request URL Status
1 `https://example.com` `301`
2 `https://www.example.com` `302`
3 `https://example.com` `301`

Requests 1 and 3 repeat the same destination pattern. This is a redirect loop.

Important: browsers can cache permanent redirects. If the Network panel does not show the full sequence, try a fresh browser profile or a browser-based HTTP header checker. Avoid submitting private URLs or authentication tokens to public checking services.

4. Fix Cloudflare HTTPS redirect loops

Cloudflare is one of the most common places where HTTPS redirect conflicts occur.

The key setting is the encryption mode between Cloudflare and your hosting server.

Understanding Flexible, Full, and Full (strict)

Mode Cloudflare-to-origin connection
Flexible HTTP
Full HTTPS, without strict certificate validation
Full (strict) HTTPS with certificate validation

Suppose Cloudflare is configured in Flexible mode.

The visitor connects to Cloudflare using HTTPS, but Cloudflare connects to your hosting server using HTTP.

Illustration of the article's main concept

Your hosting server responds:

Please use HTTPS instead.

Cloudflare repeats the HTTP request to the origin, and the same redirect happens again.

Cloudflare documents this specific conflict as a cause of `ERR_TOO_MANY_REDIRECTS`.

Step 4.1 — Check the encryption mode

  1. Sign in to the Cloudflare dashboard.
  2. Select your domain.
  3. Open SSL/TLS.
  4. Find the current encryption mode, usually under Overview.
  5. Check whether it is set to Flexible, Full, or Full (strict).

If your origin server already has a valid SSL certificate, Full (strict) is generally the preferred configuration.

Before switching, verify in your hosting panel that HTTPS is enabled and the certificate is valid for the domain. Otherwise, switching to Full (strict) may expose a certificate error instead of resolving the site.

Step 4.2 — Check other Cloudflare redirects

Also inspect:

  • SSL/TLS → Edge Certificates → Always Use HTTPS
  • Rules → Redirect Rules
  • Legacy Page Rules, if your account still uses them

Look for conflicting rules that change HTTP to HTTPS, or `www` to non-`www` and back again.

Do not disable HTTPS protection permanently just to hide the problem.

The goal is to establish one consistent destination URL and a compatible origin connection.

5. Fix redirect loops in WordPress

WordPress stores two important addresses:

  • WordPress Address (URL) — where WordPress itself is installed.
  • Site Address (URL) — the public address visitors use.

They are often identical, but not always. A WordPress installation in a subdirectory can legitimately use different values.

WordPress documents these settings and their role in site migrations.

Step 5.1 — Check the site addresses

If you can access the WordPress administration:

  1. Open Settings → General.
  2. Find WordPress Address (URL).
  3. Find Site Address (URL).
  4. Compare them with the actual website configuration.

For a normal root installation, they might both be:

https://example.com

Do not change a legitimate subdirectory installation simply to make both fields identical.

If the fields are disabled, their values may be defined in `wp-config.php`.

Step 5.2 — Check wp-config.php if the admin is inaccessible

Open your hosting control panel's file manager.

Find `wp-config.php` in the WordPress installation directory.

Download a backup before editing.

Look for:

define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');

These constants override the corresponding database options.

If they contain an old domain or incorrect protocol, they can contribute to a redirect problem.

Correct the values only after confirming the intended public URL and installation location.

WordPress documents these constants and notes that they override the stored options without changing the database values.

Step 5.3 — Recover the URLs through phpMyAdmin

If you cannot access WordPress and the URL constants are not set, you can inspect the stored options using phpMyAdmin.

  1. Open your hosting panel.
  2. Launch phpMyAdmin.
  3. Select the database used by WordPress.
  4. Locate the options table, often named `wp_options`. Its prefix may differ.
  5. Find the rows whose `option_name` values are `siteurl` and `home`.
  6. Compare their `option_value` fields with the intended addresses.

Back up the database before editing anything.

For a normal root installation, both might contain:

https://example.com

Do not perform a global search-and-replace on the entire database merely to solve a redirect loop. WordPress stores structured data, and careless replacements can cause additional problems.

Step 5.4 — Check redirect and security plugins

If the site broke immediately after changing a plugin setting, inspect plugins that manage:

  • HTTPS enforcement
  • Redirect rules
  • Login protection
  • Domain changes
  • Caching or CDN integration

If the administration is still accessible, temporarily deactivate the suspected plugin, test, then reactivate it after correcting the configuration.

If the admin is inaccessible, a hosting file manager can be used to temporarily rename a specific plugin folder, but only when you have identified a likely culprit and have a backup.

Avoid disabling all plugins indiscriminately on a live ecommerce website.

6. Fix redirect loops in Joomla

Joomla can also enforce HTTPS through its Global Configuration.

Step 6.1 — Check Force HTTPS

If the administrator interface is accessible:

  1. Sign in to Joomla.
  2. Open System → Global Configuration.
  3. Select the Server tab.
  4. Find Force HTTPS.
  5. Check the current setting.

Depending on the Joomla version, the available choices may include None, Administrator Only, and Entire Site.

For a properly configured HTTPS website, Entire Site is generally appropriate. However, the hosting server must already support HTTPS.

Joomla's official documentation explains that Force HTTPS requires HTTPS to be enabled on the server.

Step 6.2 — Check hosting and proxy configuration

If Joomla is behind Cloudflare or another reverse proxy, the application and hosting environment must agree about the request protocol.

Check the hosting control panel and any relevant reverse-proxy settings.

A site may appear to receive HTTP requests internally even though visitors connect through HTTPS, depending on how the proxy is configured.

Don't add another HTTPS rewrite rule until you've checked whether Joomla, the hosting panel, or Cloudflare is already handling the redirect.

Step 6.3 — Review recent extensions and changes

If the loop started after installing an extension, changing a system plugin, or modifying SEO settings, investigate that change first.

Technical workflow illustration

A redirect extension might be sending an old URL to a new one while another rule reverses the destination.

Temporarily disable only the suspected rule or extension, test the affected URL, and restore or correct the configuration.

7. Check .htaccess without using a terminal

On Apache-based hosting, `.htaccess` can control redirects and URL rewriting.

You can inspect it using the hosting panel's file manager.

Step 7.1 — Locate the file

Open your hosting panel and navigate to the website's document root.

Enable the option to show hidden files if necessary.

Look for:

.htaccess

Download a copy before editing.

Step 7.2 — Look for conflicting redirect rules

For example, you might find two rules that force opposite hostname formats:

RewriteEngine On

# Redirect non-www to www
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Elsewhere, another rule might redirect `www.example.com` back to `example.com`.

Both rules may be syntactically valid, but together they create a loop.

Another problem is forcing HTTPS at the server when a proxy's connection mode is incompatible.

Step 7.3 — Isolate the responsible rule

Do not replace the entire `.htaccess` file with a generic example.

Instead:

  1. Make a backup.
  2. Identify the custom rule added shortly before the problem started.
  3. Temporarily disable that specific rule by commenting it out.
  4. Save the file.
  5. Test the affected URL in a fresh browser session.
  6. If the issue disappears, correct the rule rather than leaving it disabled indefinitely.

If a redirect uses `301`, browser caching may make immediate testing misleading.

For a new redirect rule, it can be useful to test with a temporary `302` before changing it to `301`, provided the test does not disrupt existing live URLs.

8. Decide which component should control redirects

A website may have several places where redirects can be configured.

Component Examples
CDN Cloudflare Redirect Rules
Hosting panel Domain redirects, HTTPS enforcement
Web server Apache `.htaccess`
CMS WordPress/Joomla settings
Extension SEO, security, redirect plugins

Multiple redirect mechanisms are not automatically wrong.

For example, Cloudflare can redirect HTTP to HTTPS while WordPress manages redirects for deleted pages.

Problems arise when two rules disagree about the final destination.

For a typical website, choose one canonical hostname and protocol:

https://example.com

Then ensure that requests to the alternative versions converge on that address without bouncing back.

9. Verify the repair

Once the site loads again, don't stop at checking the homepage.

Test the four main address variations again.

Also check:

  • Homepage
  • Several internal pages
  • WordPress or Joomla administrator login
  • Contact forms
  • Ecommerce checkout, if applicable
  • A page with an existing intentional redirect

A healthy redirect chain might look like:

http://www.example.com/
        ↓ 301
https://example.com/
        ↓ 200 OK

A single redirect is ideal when practical, although more than one redirect is not necessarily a failure.

The key is that the chain terminates at the intended page.

What about SEO?

Redirect loops prevent users and search engines from accessing affected pages.

After fixing the configuration:

  1. Confirm that the final URL returns `200 OK`.
  2. Check that internal links use the intended HTTPS hostname.
  3. Verify that canonical URLs point to the correct pages.
  4. Review the XML sitemap.
  5. Use Google Search Console to inspect important affected URLs.

Don't change canonical tags or sitemap URLs to compensate for an unresolved server redirect loop. Fix the redirect behavior first.

10. Troubleshooting checklist

Symptom First place to investigate
Loop started after enabling Cloudflare SSL/TLS encryption mode
Loop started after enabling HTTPS Hosting and CMS HTTPS rules
Loop started after moving WordPress WordPress URL settings
Only `/wp-admin/` fails WordPress login, HTTPS, or security plugin
Only Joomla administrator fails Joomla Force HTTPS and proxy configuration
`www` and non-`www` alternate Hostname redirect rules
Loop started after editing `.htaccess` Recently added rewrite rules
Only one page fails Page-specific redirect or extension
Works in one browser only Cached redirects, cookies, or browser state

11. How to prevent redirect loops in the future

Most redirect loops happen after a configuration change.

Before modifying HTTPS, domain settings, or redirect rules:

  1. Record the current working URL and configuration.
  2. Back up relevant files and settings.
  3. Make one change at a time.
  4. Test HTTP, HTTPS, `www`, and non-`www`.
  5. Check both the homepage and administrator interface.
  6. Keep a rollback plan.

For a website using Cloudflare, verify the origin certificate before changing SSL/TLS encryption mode.

For WordPress or Joomla, check whether an existing extension already manages the redirect you intend to add.

And whenever possible, test changes on a staging site before applying them to production.

Conclusion

`ERR_TOO_MANY_REDIRECTS` usually means that different parts of a website disagree about where a visitor should go.

The most effective solution is not to clear every cache or disable every plugin. It is to identify the redirect chain and find the rule that sends the browser back to an earlier URL.

Start with your browser's Network panel. Then investigate the component most likely to be responsible: Cloudflare, the hosting panel, WordPress, Joomla, or `.htaccess`.

Once the redirect chain reaches a single canonical HTTPS address, test the entire website and keep the configuration documented.

A few minutes spent identifying the actual cause can prevent hours of unnecessary changes.

Official sources