A redirect loop occurs when a website repeatedly redirects visitors between different URLs, leading to an error message such as:
- "ERR_TOO_MANY_REDIRECTS"
- "This page isn’t working"
- "Redirect loop detected"
This can happen due to incorrect website settings, misconfigured HTTPS redirection, caching issues, or conflicts between server and website configurations.
How to Fix a Redirect Loop
Follow these steps to diagnose and resolve the issue:
Step 1: Check Cloudflare SSL Settings (If Applicable)
If your website uses Cloudflare, incorrect SSL settings can cause a redirect loop.
- Avoid the "Flexible" SSL setting, as it can conflict with HTTPS settings in website software like WordPress.
- Use "Full" or "Full (Strict)" SSL mode instead.
- Follow the steps in our guide: Enabling HTTPS on your website via Cloudflare (Step 3 is particularly important).
Step 2: Check WordPress URL Settings (If Using WordPress)
If your website runs on WordPress, incorrect URL settings can trigger a redirect loop.
- Log in to WordPress Admin and navigate to:
Settings → General - Check the WordPress Address (URL) and Site Address (URL) fields:
- If your site uses HTTPS, both URLs should begin with
https://
. - Ensure there are no unnecessary subdomains or typos.
- If your site uses HTTPS, both URLs should begin with
If you cannot access WordPress Admin due to the loop, you can update the URLs via phpMyAdmin:
- Open phpMyAdmin in cPanel.
- Select your WordPress database.
- Find the table
wp_options
. - Edit the values for
siteurl
andhome
.
Step 3: Check for Mixed Protocol Redirects (HTTP vs HTTPS)
A common cause of redirect loops is an incorrect mix of HTTP and HTTPS redirects.
- Ensure that your
.htaccess
file properly handles HTTPS redirections. - If your website forces HTTPS via plugins, Cloudflare, and
.htaccess
at the same time, it may create a loop.
Step 4: Clear Cache and Cookies
Caching issues can cause browsers to store old redirect rules, leading to persistent loops.
- Clear your browser cache and cookies.
- Test in Incognito Mode or a different browser.
- Try disabling caching plugins if using WordPress or similar web applications.
Step 5: Check and Reset .htaccess
Incorrect .htaccess
rules can cause redirect loops. To check if there are any faulty rules in your site's .htaccess
file, please try the following steps:
- Access your website files via FTP or File Manager in cPanel.
- Locate and temporarily rename the
.htaccess
file (e.g.,.htaccess_backup
). - Visit your website and check if the issue is resolved.
Important: Renaming or removing the .htaccess
file is only a short-term troubleshooting step. This file plays a crucial role in controlling redirects, security rules, and access restrictions. Without it, certain site functions, including URL rewriting for SEO-friendly links, security rules, and custom access controls, may stop working. Once the issue is diagnosed, restore the .htaccess
file and carefully review its rules to prevent further problems.
If your .htaccess
file contains many sets of rules which are required for your website, you can try to remove each set of rules, one by one, until you identify the one possibly causing the redirect loop.
On WordPress sites, it is possible to generate a new .htaccess
file by going to: WordPress Admin → Settings → Permalinks → Click "Save Changes". However, please note that some plugins may have their own set of rules which may need to be re-added to the file.
Step 6: Use Online Redirect Checking Tools
You can diagnose the issue using online redirect tracing tools:
These tools will show the redirection path and help identify where the loop occurs.
Step 7: Use Online Syntax Checking Tools
There are several online tools that can check the syntax and potential issues in an .htaccess
file:
-
-
Allows you to test your .htaccess rules.
-
Simulates how the redirects will behave.
-
Helps debug issues with mod_rewrite and redirection loops.
-
-
Apache .htaccess Syntax Checker
-
Performs a syntax check to find errors in .htaccess rules.
-
Highlights incorrect directives or missing syntax.
-
-
ConfigCheck (for Apache Configs)
-
Validates Apache configuration files, including .htaccess.
-
Checks for syntax errors and incorrect directives.
-
Step 8: Check the "error_log" File and Web Server Logs
Errors related to redirect loops can sometimes get logged in your site's error_log
file or in the web server logs. Here's how you can check and analyse them:
Step 9: Contact Support for Further Assistance
If you’ve tried the above steps and the issue persists, our support team can help by:
- Checking server logs.
- Analysing redirect configurations.
- Identifying conflicts with plugins or security settings.
Please submit a support ticket with details of the issue, including any recent website changes and whether Cloudflare is enabled.
Updated by SP on 11/02/2025