# Fixing "too many redirects" (ERR_TOO_MANY_REDIRECTS)

> Your site keeps redirecting in a loop after switching to HTTPS. Here are the usual causes and how to fix each one.

Source: https://helpcenter.ruachost.com/ssl-security/ssl-troubleshooting/too-many-redirects/

**"This page isn't working. example.com redirected you too many times"** (`ERR_TOO_MANY_REDIRECTS`) means your site is sending visitors round in a circle, usually between `http://` and `https://`, or between `www` and non-`www`.

Clear your browser's cookies for the site and try a private window first. If the loop is still there, check these causes in order.

## 1. Cloudflare set to "Flexible"

This is the most common cause. In **Flexible** mode, Cloudflare connects to your server over `http://`. Your server redirects to `https://`, Cloudflare passes it back over `http://`, and so on forever.

**Fix:** in Cloudflare, go to **SSL/TLS → Overview** and choose **Full** or **Full (strict)**. Your Ruachost free SSL works with both.

## 2. The HTTPS redirect is set up more than once

For example, an `.htaccess` rule **and** cPanel's **Force HTTPS Redirect** **and** a WordPress SSL plugin, all at once. Keep **one** and remove the others. See [How to force HTTPS on your website](https://helpcenter.ruachost.com/ssl-security/ssl-certificates/how-to-force-redirect-http-to-https-using-htaccess/).

## 3. Conflicting www and non-www redirects

One rule sends `www.example.com` to `example.com`, and another sends it back. Check:

- your `.htaccess` file
- cPanel **Domains → Redirects**
- in WordPress, **Settings → General**: both addresses must match the version your redirects send people to, including `https://` and `www` (or not).

## 4. WordPress site address mismatch

If you can't reach the dashboard, set the addresses in `wp-config.php` (in File Manager), above the line `/* That's all, stop editing! */`:

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

Replace `example.com` with your domain, matching `www` or not. Then clear the cache. With LiteSpeed Cache, use **Purge All**, or delete the `wp-content/cache` folder if you can't log in.

## 5. A caching or security plugin

Temporarily rename the `wp-content/plugins` folder in File Manager to turn off all plugins. If the loop stops, rename it back and turn plugins on one at a time to find the cause.

Still looping? [Open a support ticket](https://dashboard.ruachost.com/submitticket.php) with your domain name and we'll trace the redirects for you.
