Help

How to fix “too many redirects” in WordPress

Your browser shows “too many redirects”, or ERR_TOO_MANY_REDIRECTS in Chrome, when your WordPress site sends it round in a loop. The usual cause is a WordPress Address that does not match how the site is reached: http or https, www or not. Conflicting HTTPS rules in .htaccess, a plugin or a CDN can loop too.

Updated · HostUpIndia team

What causes “too many redirects”

Each redirect sends the browser to another address. When two rules disagree, they send it back and forth until the browser gives up.

  • A WordPress Address or Site Address that does not match the address the server sends visitors to, such as http against https, or www against no www.
  • A CDN or proxy, such as Cloudflare in Flexible SSL mode, that connects to your server over http while the server forces https.
  • Conflicting redirect rules in .htaccess, in cPanel, or in a redirect or SSL plugin.
  • A cache that still serves an old redirect.
  • Old cookies in your browser, which can keep a loop going after the fix.

Clear cookies and find the loop

Rule out your browser first.

  • Open the site in a private (incognito) window.
  • If it loads there, clear the cookies and cached files for your site in your browser’s settings, then reload.
  • Try another browser or device.
  • To see each redirect, run curl -IL https://example.com in a terminal, with your own domain. A loop repeats the same two addresses until curl stops.

Fix the WordPress Address and Site Address

Both should use the exact address your site loads on, usually the same for both.

  • In the WordPress dashboard, open Settings › General.
  • Set WordPress Address (URL) and Site Address (URL) to your address, with or without www as your site uses it, for example https://example.com. Use https only if the site has a valid SSL certificate.
  • Click Save Changes, clear your cookies and reload.
  • If you cannot open the dashboard, open wp-config.php in cPanel › File Manager and add define( 'WP_HOME', 'https://example.com' ); and define( 'WP_SITEURL', 'https://example.com' ); above the “stop editing” comment.
  • Or open cPanel › phpMyAdmin, choose the database named in DB_NAME in wp-config.php, and open the options table, wp_options by default.
  • Edit the option_value of the siteurl and home rows to the same address, with no slash at the end.
  • Values set in wp-config.php override the database and lock the two fields in Settings › General. Remove the lines to edit them there again.

Check .htaccess and plugins

If the addresses are right, another redirect is fighting them.

  • In cPanel › File Manager, open public_html and turn on Show Hidden Files in Settings to see .htaccess.
  • Look for RewriteRule lines that send visitors to https or www, usually above # BEGIN WordPress. Keep one HTTPS rule, and make its target match the WordPress Address.
  • To test, rename .htaccess to .htaccess.bak and reload the site. If the loop stops, rename it back and remove the rule that caused it.
  • Check cPanel › Redirects for a redirect on the same domain that disagrees with the WordPress Address.
  • In cPanel › Domains, see whether Force HTTPS Redirect is on. Force https in one place only: there, in .htaccess or in a plugin.
  • In WordPress, open Plugins and deactivate redirect, SSL and cache plugins, then test again.
  • If you cannot sign in, rename a plugin’s folder in wp-content/plugins, for example to plugin-name-off. A renamed plugin does not load.
  • Purge the cache in your cache plugin and your CDN after each change.
  • If the site shows a 500 error after an .htaccess edit, see how to fix the WordPress 500 error.

Check the SSL certificate and CDN

A site that forces https needs a valid certificate on the server. Behind a CDN, the SSL mode matters too: Cloudflare’s Flexible mode connects to your server over http, so a server that forces https redirects every request, and the loop never ends.

  • In cPanel, open SSL/TLS Status and check that your domain has a valid certificate.
  • If it does not, click Run AutoSSL, where your host offers it, to issue a free certificate.
  • In Cloudflare, open SSL/TLS and set the encryption mode to Full (strict), once the server has a valid certificate.
  • With another CDN or proxy, set it to connect to your server over https.
  • Purge the CDN cache, clear your cookies and reload.

WordPress hosting with free SSL

HostUpIndia WordPress hosting includes free SSL, so your site can force https without buying a certificate. WordPress comes pre-installed on LiteSpeed, with NVMe storage, cPanel and daily backups kept 30 days.

From ₹149 a month on 3-year billing. Prices exclude 18% GST. See WordPress hosting plans.