The “Too Many Redirects” issue on WordPress usually occurs due to misconfiguration in the site’s URL settings, SSL setup, or conflicts between the .htaccess
file and WordPress routing. Here’s how you can troubleshoot and resolve the issue:
1. Check WordPress URL Settings
- Go to Settings > General in your WordPress dashboard.
- Ensure that the WordPress Address (URL) and Site Address (URL) match and are set correctly. For example, both should be either:
https://yourdomain.com
http://yourdomain.com
(depending on whether you are using SSL). Note: Make sure you’re not mixinghttp://
andhttps://
in the URLs.
2. Clear Browser and WordPress Cache
- Clear Browser Cache: Sometimes, cached redirects in your browser can cause the issue.
- Clear WordPress Cache: If you’re using a caching plugin (like W3 Total Cache, WP Super Cache, etc.), clear the cache from the plugin’s settings.
- You can also try temporarily disabling the caching plugin to see if it resolves the issue.
3. Check the .htaccess File
There may be issues with the .htaccess
file causing a redirect loop. Ensure it’s configured correctly:
- Access
.htaccess
:
- Use FTP or File Manager from your hosting control panel.
- Navigate to the root folder where WordPress is installed and find the
.htaccess
file.
2. Replace the
.htaccess
Content:
Use the default WordPress.htaccess
configuration:
# 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
- Save the file and clear your browser cache again.
4. Disable Any Redirection Plugins
If you are using any redirection plugins (like Redirection, Simple 301 Redirects, etc.), they might be misconfigured and causing a loop.
- Disable any redirection plugins you’re using and check if the error persists.
- If disabling the plugin resolves the issue, you might need to reconfigure or remove any conflicting redirect rules.
5. Force HTTPS (if applicable)
If your site uses SSL, incorrect HTTP-to-HTTPS redirects can cause a loop.
- Ensure you’ve configured HTTPS correctly in the WordPress URL settings (as in step 1).
- Add the following rule to your
.htaccess
file if you want to force HTTPS:
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
6. Check for Conflicting Plugins or Theme Issues
- Temporarily switch to a default theme like Twenty Twenty-One and check if the issue persists.
- Disable all plugins and re-enable them one by one to isolate if a specific plugin is causing the issue.
7. Review the Server Configuration (Hostinger-Specific)
If you are hosting your WordPress site on Hostinger, their server configuration might be influencing this behavior:
- Check Hostinger’s hPanel for any additional URL redirect settings.
- Ensure SSL is properly configured in the SSL/TLS Settings in hPanel.