Fix Too Many Redirects After Enabling SSL
You installed a certificate, forced HTTPS, and now the site says "too many redirects". The browser followed a chain of redirects that never ends. The cause is two settings that disagree, and you can find which one in a few minutes by looking at the actual response headers.
Too many redirects with SSL: trace the loop
curl -sIL --max-redirs 5 http://example.com | grep -iE '^(HTTP|location|server)'
Look at where each hop goes. Examples of what you might see:
| Pattern | Meaning |
|---|---|
| https to https (same URL) | The app or proxy redirects HTTPS requests because it thinks they are HTTP |
| http to https to http | One rule forces HTTPS while another sends users back to HTTP |
| www to non-www to www | Two canonical host rules conflict |
| Loop only on a path like /wp-admin | FORCE_SSL_ADMIN or a security plugin behind a proxy |
The redirect checker shows the same hops without a terminal.
Step 2: Check each layer
- CDN or proxy: Cloudflare in Flexible mode with an origin that redirects to HTTPS creates a loop. Use Full (strict). See Cloudflare SSL errors.
- Web server rules: look at .htaccess, Nginx server blocks and the host's "force HTTPS" toggle.
- Application: CMS settings, framework middleware and plugins.
Apache .htaccess fix
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
The X-Forwarded-Proto condition avoids a loop when a proxy handles TLS. Remove older rules that do the same job in a different form.
Nginx fix
server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate /path/fullchain.pem;
ssl_certificate_key /path/privkey.pem;
return 301 https://example.com$request_uri;
}
Do not add another redirect to HTTPS inside the 443 block for the main host.
Too many redirects with SSL: the WordPress fix
Make sure Settings, General has https:// in both URL fields. Add the proxy header handling to wp-config.php if you run behind a load balancer or CDN:
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
Temporarily deactivate redirect or SSL plugins to check whether one of them adds a second rule. The rules for forcing HTTPS in .htaccess and Nginx list the safe form.
Step 3: Clear caches
Clear the browser cache and cookies, the server or plugin cache and any CDN cache. Test in a private window. Browsers remember 301 redirects, so a fixed server can still look broken on your machine.
Confirm the fix
Re-run the curl command. You want one 301 and then a 200. Run the SSL checker to confirm the certificate and chain, and watch for the redirect source in a CDN that was left on.
Prevent a repeat
Keep one owner for the HTTPS redirect and note it in your site documentation. Whenever you add a CDN, caching plugin or security plugin, re-run the curl trace. Most loops return after one of those changes, not after a certificate change. Also keep a copy of your last working .htaccess or server block so you can roll back in a minute.
Related reading: Cloudflare SSL with WordPress, Fix SSL on Nginx Proxy Manager and Caddy and enabling HSTS.
Frequently Asked Questions
Is the certificate to blame?
Rarely. A loop is a redirect issue, not a certificate fault.
Why does it only affect some pages?
Rules that match paths, such as admin or checkout pages, may differ from the rest of the site.
Can I use a meta refresh instead?
No. Use a server-side 301, which is faster and understood by search engines.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.