How to Fix the err_too_many_redirects Error in WordPress

Here is the translation of your text into English:

Title: How to Fix the err_too_many_redirects Error in WordPress

The err_too_many_redirects error is caused by a site entering into a redirection loop. When redirections occur in a loop, the browser or web server will attempt to break the loop and return an error page to site visitors.

What Causes the Redirection Loop?
The reason for this issue is having multiple conflicting redirection commands somewhere in your code, files, or settings. The most common problem is when a website redirects from http to https and then redirects back to http, creating a loop.

Checking .htaccess and wp-config.php Files
To solve the problem, you can start by checking the .htaccess and wp-config.php files.

The .htaccess file is usually located under the public_html directory.

Make a backup of the file either through cPanel or FTP. Then, you can delete the content of the file and replace it with the default WordPress .htaccess content, as shown below:

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

In the wp-config.php file, check if either or both of these lines are set:

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

If these definitions are set, they should generally both be set to https://yourdomain.com.

Finally, if you are using Cloudflare:

Ensure that SSL/TLS is set up correctly in Cloudflare. Setting it to Flexible or Full can sometimes cause redirection loops.

Leave a Comment