Get in touch
Back to blog
August 2nd, 2022

How to fix ERR_TOO MANY REDIRECTS (5 Methods)

by Luca Reale
cropped-luca.png

Few things are more discouraging than trying to access your WordPress site and being met with an error message. The ERR_TOO MANY REDIRECTS error is a common issue that can be tricky to solve as it can be caused by so many different things.

Worse still, if your site has too many redirects, you might not even be able to access your WordPress dashboard to troubleshoot it.

Don’t worry. In this article, we’ll look at what causes this error and explain 5 methods to fix ERR_TOO MANY REDIRECTS and get your site up and running again. 

What is a redirect error?

A redirect error, also known as a redirect loop (or by the error message: ERR_TOO MANY REDIRECTS), happens when a web page redirects back and forth too many times. 

Essentially URL 1 redirects to URL 2, and URL 2 redirects back to URL 1. This goes on until your browser gives up and shows an error message. Redirect loops can also be caused by a page redirecting to itself.

Redirect error messages in different browsers

ERR_TOO MANY REDIRECTS will show a slightly different error message depending on your browser. 

  • Google Chrome: “This page has a redirect loop” or “this page redirected you too many times”
  • Mozilla Firefox: “This page isn’t redirecting properly”
  • Microsoft Edge: “domain.com redirected you too many times”
  • Safari: “Too many redirects occurred trying to open “domain.com.” This might occur if you open a page that is redirected to open another page which is then redirected to open the original page.”

How redirect loops affect your SEO

As well as making pages on your site inaccessible, a redirect loop can have a negative impact on your SEO. Redirects pass on linking authority and give instructions to crawlers, so a redirect error will prevent search engines from indexing your site.

How to fix ERR_TOO MANY REDIRECTS in WordPress

Here are some things you can try to fix the error:

1. Clear cookies and cache

  • In some instances, a redirect error occurs because of cookies in your browser. Try deleting your cookies and see if the error goes away.
  • The error could also be a result of caching in your browser. Check if this is the cause of the problem by opening a window in incognito mode (also known as private browsing) and trying to access the site from there. If the redirect error no longer shows, then clearing your browser cache should fix it. 

To clear your cache in Google Chrome, go to Settings> Privacy & Security> Clear Browsing Data and make sure to check the option for “Cached images and files.”

  • Redirect errors can be caused by old redirects being cached. Try clearing the cache on your WordPress site to see if this solves the issue. You can do this by accessing your site files through your FTP (File Transfer Protocol) client, then going to the “wp-content” folder. Open the folder named “cache” and delete all the files inside. Make sure not to delete the folder itself, though.
  • Alternatively, you can use a variety of WordPress plugins to clear your cache, such as WPRocket or W3 Total Cache. 

2. Disable plugins

While WordPress plugins are immensely useful, they are also one of the most common causes of redirect loops. Often, plugins can create their own redirects which conflict with pre-existing redirects, causing a loop. 

To find out if plugins are behind your problem, you can disable them by going to the “Plugins” section in your dashboard. Select all your plugins, then click on the “Bulk Actions” drop-down menu and click “Deactivate”. Now press “Apply”, and your plugins will be deactivated.

If the error is resolved, you can now re-activate your plugins one by one to find out which one was causing the issue. 

However, redirect errors can make you unable to access your dashboard. In this case, you can disable plugins using FTP or cPanel. Open your site files and go to the folder named “wp-content”. Find the “plugins” folder and rename it to “plugins.deactivate”. 

3. Reset Your .htaccess file

Your WordPress site’s redirects are contained in your .htaccess file. Plugins can add redirects to this file, and these redirects aren’t always removed completely when deactivating a plugin. Redirect errors can also come from misconfigured redirects in the .htaccess file. (We’ll touch on that in a moment.)

To find out if the problem arises from .htaccess, you can perform a quick reset. In your File Manager, look in the “public_html” folder. If you can’t see the .htaccess file, click on Settings and check the box labelled “Show Hidden Files”. 

Before making any changes, make sure you have a backup of your WordPress site, just in case. 

To reset your .htaccess, you should first disable the existing file. You can do this by adding a non-recognised file extension, for example, renaming it to “.htaccess.bak”. Now you can create a new file containing the default .htaccess code. 

Open a Notepad file and write the following: 

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Now name the file “.htaccess” and upload it. Notepad will try and name it “.htaccess.txt” so be sure to remove the “.txt” extension. 

If you are using cPanel you can also create a new file directly in the file manager without using Notepad.

4. Check your HTTPS redirects & SSL

ERR_TOO MANY REDIRECTS is a common issue that people face when they’ve configured 301 redirects. These redirects indicate that a URL has permanently moved to a new destination. If you’ve recently moved your WordPress site to a new domain or upgraded from HTTP to HTTPS then the issue could be down to misconfigured redirects.

  • Another common mistake that causes redirect loops is forcing an HTTPS redirect without installing an SSL certificate first. You can fix this by installing an SSL certificate.
  • If you are using CloudFlare hosting, your problem could be due to their “Flexible SSL” setting. This option sends traffic to your server over HTTP, which can conflict with your server’s existing HTTP/HTTPS redirects. To fix this, you can change the setting from “Flexible” to “Full”. 

5. Check your WordPress URL settings

A redirect loop can be the product of inconsistencies in your WordPress URL settings. WordPress has two URL fields:

  • WordPress Address (the URL to access your site)
  • Site Address (where your site files are stored)

If these two addresses do not match, then it can result in a redirect loop. To check your URL settings, go to the General Settings in your WordPress dashboard. Small mistakes like a blank space before the URL, using HTTP on one URL and HTTPS on another, or even not including “www” can cause the error. 

If you can’t access your dashboard, you can change the URLs manually. There are two ways you can do this. 

Note: Be sure to make a backup of your site files in case anything goes wrong.

1. Editing the functions.php file

  • Open your site files via FTP or cPanel
  • Open the “wp-content” folder and find the “themes” folder
  • Open the folder of the theme you are using
  • Locate the “functions.php” file, download it and open it in Notepad (if you are using Filezilla, you can just use the “Edit File” function)
  • Add these two lines of code underneath the “<?php” tag, replacing “example.com” with your site name
update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );
  • Upload the functions.php file to your site files and reload the site. 
  • Once you can access your site, make sure to remove the code from the functions.php

If you cannot find a functions.php file, you can make one yourself. Create a new file in a text editor and write:

<?php
update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );

Name the file “functions.php” and upload it to your site.

2. Editing the wp-config file

The wp-config file is very important, so make sure to back up your site before making changes to it. 

  • Using FTP or cPanel, open your site files and go to the folder named “public_html”
  • Find the “wp-config” file and download it
  • Open the file in a text editor like Notepad or Notepad++. 
  • Just above the line that says: “‘That’s all, stop editing! Happy publishing’” insert the following, replacing “example.com” with your site’s name:
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
  • Now you can upload the file to your site and see if that has fixed it. 

Important: Only edit PHP files in a text editor. Do not use word processors like Microsoft Word as they can mess up the formatting. 

Summary

Following these steps will allow you to identify and solve the cause of your redirect loop. It can be a fiddly problem to pin down, but the methods above will address the most common causes for redirect errors.

Category:
cropped-luca.png
Luca Reale
Content writer

Our newsletter

Our links

Our Work

Our Content

Social

Copyright © 2024 Drewl (Luna Digital Ltd.). All rights reserved