How to Fix “Too Many Redirects” Error in cPanel, Cloudflare and LiteSpeed
Have you ever opened your website and received the message “This page isn’t working. Too many redirects”?
In Google Chrome, the browser may display ERR_TOO_MANY_REDIRECTS. Other browsers may show messages such as “The page isn’t redirecting properly.”
This error can prevent visitors from accessing your website, even when your domain is active and your hosting server is running.
It often happens after enabling SSL, connecting a domain to Cloudflare, changing website URLs, modifying .htaccess or migrating to another hosting provider.
The problem is usually caused by a redirect loop, where a website repeatedly sends visitors between URLs without reaching the intended page.
In this guide, we’ll explain what causes redirect loops and how to fix the Too Many Redirects error in cPanel hosting, Cloudflare, LiteSpeed and other common hosting environments.
What Does ERR_TOO_MANY_REDIRECTS Mean?
A redirect tells a browser to request a different URL.
For example, when someone visits:
http://example.com
The website may redirect them to:
https://example.com
This is a normal redirect that helps visitors use the secure HTTPS version of the website.
Problems occur when two or more redirect rules conflict.
For example:
http://example.com
|
v
https://example.com
|
v
http://example.com
|
v
https://example.com
|
v
Redirect Loop
The browser keeps following redirects until it reaches its redirect limit.
It then stops loading the page and displays an error.
Redirect loops can occur at several layers, including the CDN, web server, application and browser.
What Causes Too Many Redirects Errors?
The most common causes include:
- Conflicting HTTP and HTTPS redirect rules
- Incorrect Cloudflare SSL/TLS settings
- Duplicate redirects in
.htaccess - Incorrect application URLs
- Conflicting www and non-www redirects
- Redirect rules configured in multiple systems
- Incorrect reverse proxy configuration
- Misconfigured application authentication
- Browser cookies or session problems
- Errors introduced during website migration
The correct solution depends on where the redirect originates.
1. Incorrect Cloudflare SSL/TLS Settings
One common cause of redirect loops involves the interaction between Cloudflare and the origin hosting server.
Cloudflare supports several SSL/TLS encryption modes.
These determine how Cloudflare communicates with your hosting server.
Flexible SSL
In Flexible mode, visitors can connect to Cloudflare over HTTPS while Cloudflare communicates with the origin using HTTP.
This can cause a redirect loop if the origin server automatically redirects HTTP requests to HTTPS.
For example:
Visitor requests HTTPS
|
v
Cloudflare Flexible SSL
|
v
Origin receives HTTP
|
v
Origin redirects to HTTPS
|
v
Cloudflare repeats HTTP request
|
v
Redirect Loop
How to Fix It
If your origin server has a suitable valid SSL certificate:
- Log in to Cloudflare.
- Select your domain.
- Open SSL/TLS.
- Review the encryption mode.
- Select Full (strict) when the origin certificate meets its requirements.
- Save the changes.
- Test the website again.
Full (strict) provides encryption between visitors and Cloudflare and between Cloudflare and the origin, with certificate validation on the origin connection.
If the origin doesn’t have a suitable certificate, install or correct one before selecting Full (strict).
Don’t use Flexible SSL as a permanent workaround for an incorrectly configured origin.
2. Conflicting HTTPS Redirect Rules in .htaccess
The .htaccess file controls various Apache-compatible web server behaviors.
These can include URL rewriting and redirects.
LiteSpeed also supports many Apache-compatible .htaccess directives.
A redirect loop may occur when two rules contradict one another.
For example, one rule may redirect HTTP to HTTPS while another redirects HTTPS back to HTTP.
How to Check .htaccess in cPanel
- Log in to cPanel.
- Open File Manager.
- Navigate to your website’s document root.
- Enable Show Hidden Files if necessary.
- Locate
.htaccess. - Download a backup before editing.
For a primary domain, the document root may be public_html.
For an addon domain or subdomain, the document root may be different.
Always confirm the correct directory through cPanel’s Domains interface.
Example HTTPS Redirect Rule
For a website that should always use HTTPS, a basic rule may look like this:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
This is a simple example for environments where the web server correctly identifies HTTPS connections.
Important: Reverse proxy configurations may require additional considerations. Don’t blindly copy this rule when Cloudflare or another proxy terminates HTTPS upstream.
What to Look For
Review .htaccess for:
- Duplicate HTTPS redirects
- HTTP redirects that contradict HTTPS redirects
- Conflicting www and non-www rules
- Redirects pointing back to the original URL
- Application-generated rewrite sections
- Rules added by security or caching plugins
Remove or correct conflicting rules rather than deleting the entire .htaccess file.
3. Conflicting www and Non-www Redirects
Some websites use:
https://www.example.com
Others use:
https://example.com
Either format can work.
The important thing is to select one preferred hostname and configure redirects consistently.
Example Redirect Loop
A server rule redirects:
www.example.com → example.com
But a CDN rule redirects:
example.com → www.example.com
The visitor is repeatedly redirected between the two hostnames.
How to Fix It
Decide which hostname should be canonical.
Then review redirect rules in:
- Cloudflare
- cPanel
.htaccess- LiteSpeed
- Your website application
- Any additional reverse proxy
Make sure the rules point toward the same final destination.
Avoid configuring contradictory redirects in multiple places.
4. Incorrect Website URL Settings
Some applications store their website address in configuration files or database settings.
If the configured URL conflicts with the web server or CDN, redirect loops can occur.
For example, an application may be configured to use HTTP while the server forces HTTPS.
Other applications may enforce a particular hostname.
How to Fix It
Review your application’s base URL or site URL configuration.
Confirm that it matches the intended public website address.
For example:
https://example.com
Also verify that the application correctly recognizes HTTPS when running behind a reverse proxy.
The required configuration depends on the application.
Avoid changing database values without understanding how your software stores its URL settings.
5. Cloudflare Redirect Rules Causing a Loop
Cloudflare supports redirect configuration through features such as Redirect Rules.
These rules can be useful for:
- Redirecting HTTP to HTTPS
- Redirecting old URLs
- Enforcing a preferred hostname
- Moving visitors to another domain
However, conflicting rules may create loops.
Example
A Cloudflare rule redirects:
https://example.com → https://www.example.com
Meanwhile, the hosting server redirects:
https://www.example.com → https://example.com
Both systems are functioning according to their rules, but the combined configuration prevents the website from loading.
How to Fix Cloudflare Redirect Loops
- Open your Cloudflare dashboard.
- Select the affected domain.
- Navigate to Rules.
- Review active redirect rules.
- Identify rules affecting the same hostname or URL.
- Temporarily disable a suspected rule if appropriate.
- Test the website.
- Correct the conflicting rule.
Also review relevant HTTPS-related settings.
Don’t disable all security or caching features without identifying the actual problem.
6. LiteSpeed Redirect Configuration Problems
LiteSpeed is commonly used with cPanel hosting.
It supports Apache-compatible rewrite rules and can work with applications that generate their own redirects.
Redirect loops may occur when multiple components attempt to enforce different URL formats.
For example:
- LiteSpeed redirects HTTP to HTTPS.
- The application redirects HTTPS to HTTP.
- Cloudflare enforces another redirect.
- A plugin redirects between www and non-www.
How to Troubleshoot LiteSpeed Redirect Problems
Start with the website’s .htaccess file.
Review any application-level redirect settings.
If you administer the server, inspect LiteSpeed logs and relevant virtual host configuration.
Avoid changing global LiteSpeed settings to resolve a problem affecting only one website until you’ve investigated the account-level rules.
7. Browser Cookies and Session Problems
Not every redirect loop is caused by .htaccess or Cloudflare.
Some applications redirect users based on login sessions or cookies.
For example:
- A user opens a protected dashboard.
- The application redirects to the login page.
- The login page incorrectly detects an authenticated session.
- The application redirects back to the dashboard.
- The cycle repeats.
How to Test
Open the website in a private browsing window.
If the website works there, browser cookies or stored session information may be involved.
You can then clear cookies for the affected website.
However, if the problem occurs for every visitor, investigate the server and application configuration rather than assuming it’s a browser issue.
8. Redirect Loops After Website Migration
Website migrations can introduce redirect problems.
This may happen when moving between:
- Apache and LiteSpeed
- Different hosting providers
- HTTP and HTTPS configurations
- Different domain names
- CDN and non-CDN environments
Common Migration Problems
- Old redirect rules remain active.
- The application still uses its previous domain.
- The new server forces a different hostname.
- Cloudflare uses an incompatible SSL mode.
- A reverse proxy doesn’t pass expected request information.
- Application configuration files contain outdated URLs.
Recommended Solution
Review the full redirect chain from the visitor to the application.
Check the intended hostname, protocol and origin server configuration.
Test important pages after making changes.
How to Identify a Redirect Loop Using curl
If you have access to a terminal, curl can help inspect HTTP response headers.
To check the first response:
curl -I https://example.com
Look for the HTTP status code and Location header.
For example:
HTTP/2 301
location: https://www.example.com/
This indicates that the server is redirecting the request.
To follow redirects:
curl -IL --max-redirs 10 https://example.com
The output can reveal whether the URL repeatedly changes between the same destinations.
Be aware that some websites respond differently to HEAD requests.
If necessary, inspect ordinary GET requests without downloading large amounts of content.
What to Look For
Identify patterns such as:
http://example.com
https://example.com
http://example.com
https://example.com
Or:
https://example.com
https://www.example.com
https://example.com
These patterns suggest conflicting redirect rules.
How to Fix Too Many Redirects in cPanel: Step-by-Step
Follow this troubleshooting sequence.
Step 1: Confirm the Affected URL
Check whether the problem affects:
- The homepage
- Every website page
- A specific directory
- The login page
- One subdomain
This helps narrow down the source.
Step 2: Test in a Private Browser Window
Open the affected URL in a private window.
If it works, investigate cookies and session behavior.
Step 3: Check SSL Configuration
Verify that the domain has a suitable SSL certificate.
If you use Cloudflare, confirm that its SSL/TLS mode is compatible with the origin configuration.
Step 4: Review .htaccess
Open the .htaccess file in the correct document root.
Look for duplicate or conflicting redirect rules.
Create a backup before making changes.
Step 5: Check cPanel Redirects
In cPanel, open the Redirects interface if available.
Review configured redirects.
Be aware that some redirects may also be stored directly in .htaccess.
Step 6: Review Cloudflare Rules
Check Redirect Rules and HTTPS-related settings.
Make sure they don’t conflict with origin-server redirects.
Step 7: Check Application URL Settings
Confirm that your application uses the intended public URL.
Review its HTTPS and reverse proxy configuration.
Step 8: Test the Redirect Chain
Use browser developer tools or curl to inspect the redirects.
Confirm that the website reaches the correct final destination.
Step 9: Contact Your Hosting Provider
If the issue persists, contact your hosting provider.
Provide the affected URL, error message and details of any recent configuration changes.
Should You Disable HTTPS Redirects to Fix the Problem?
Not necessarily.
HTTPS redirects are useful for ensuring visitors access the secure version of a website.
The problem is usually not the existence of an HTTPS redirect.
It’s the conflict between multiple redirect rules or incorrect HTTPS detection.
Instead of removing HTTPS protection, identify which rule causes the loop.
For a properly configured website, HTTP requests should generally redirect to the intended HTTPS URL without being redirected back.
Can Clearing Cache Fix Too Many Redirects?
Sometimes.
Browsers may cache redirects, and CDN caching can also affect what visitors receive.
However, clearing cache won’t permanently fix conflicting server-side rules.
If the website continues redirecting between the same URLs, the configuration must be corrected.
Recommended Approach
After fixing the underlying rules:
- Test in a private browser window.
- Clear relevant browser data if necessary.
- Purge affected CDN content where appropriate.
- Test the redirect chain again.
Don’t disable all website caching permanently unless there’s a specific technical reason.
Can Too Many Redirects Affect SEO?
Yes, persistent redirect loops can interfere with search engine crawling and indexing.
Search engines need to reach the final destination to retrieve page content.
If a URL repeatedly redirects without resolving, crawlers may be unable to access the intended page.
This can affect discoverability and user experience.
SEO Best Practices for Redirects
- Use a consistent canonical hostname.
- Redirect HTTP to HTTPS correctly.
- Avoid unnecessary redirect chains.
- Prevent redirect loops.
- Update internal links to point to final URLs.
- Check important URLs after migrations.
- Monitor crawl and indexing errors.
A properly configured redirect should take visitors to the intended destination without unnecessary intermediate steps.
How to Prevent Redirect Loops
You can reduce the likelihood of redirect errors by following these practices.
Use One Preferred Website URL
Choose whether your website should use www or non-www.
Configure your application and redirects consistently.
Maintain Correct SSL Settings
Ensure that your CDN and hosting server use compatible encryption configurations.
Avoid Duplicate Redirect Rules
Don’t configure conflicting redirects in multiple systems.
Review .htaccess Carefully
Back up the file before editing.
Keep application-managed rewrite sections intact.
Test After DNS or CDN Changes
Whenever you change nameservers, proxy settings or SSL configurations, test the website.
Review Application Configuration
Make sure the application recognizes the correct protocol and hostname.
Monitor Redirect Behavior
Use browser developer tools, curl or suitable monitoring tools to identify unexpected redirect chains.
Web Hosting Solutions at Beta Host Limited
Beta Host Limited provides hosting services for individuals, businesses and developers.
If your website experiences redirect problems, reviewing the domain, SSL and application configuration is an important first step.
Shared Web Hosting
For websites that fit within the selected package’s resource allocations.
WordPress Hosting
For websites built using WordPress.
VPS Hosting
For applications requiring greater server control and allocated virtual resources.
Before ordering, review the available package specifications and features.
If you’re already a Beta Host customer and your website is experiencing redirect loops, contact technical support with the affected URL and any recent configuration changes.
Frequently Asked Questions
What does ERR_TOO_MANY_REDIRECTS mean?
It means the browser encountered too many redirects while attempting to load a website, often because two or more redirect rules conflict.
Can Cloudflare cause Too Many Redirects?
Yes. Incompatible SSL/TLS settings or conflicting redirect rules between Cloudflare and the origin server can cause redirect loops.
How do I fix Too Many Redirects in cPanel?
Check SSL configuration, .htaccess, cPanel redirects, application URL settings and CDN redirect rules.
Does LiteSpeed support .htaccess redirects?
Yes. LiteSpeed supports many Apache-compatible rewrite directives commonly used in .htaccess files.
Can an SSL certificate cause redirect loops?
An SSL certificate alone doesn’t normally create a redirect loop, but incorrect HTTPS handling or incompatible proxy settings can contribute to one.
Should I use Cloudflare Flexible SSL?
When your origin server supports a suitable valid certificate, Full (strict) is generally preferable. Flexible mode can cause redirect loops when the origin forces HTTPS.
Can clearing browser cookies fix the problem?
Yes, if the redirect loop is related to login sessions or cookies. It won’t fix conflicting server-side redirect rules.
Will deleting .htaccess fix Too Many Redirects?
Deleting .htaccess isn’t recommended as a first step. It may remove essential application rewrite rules and cause additional errors.
Can Too Many Redirects affect Google rankings?
Persistent redirect loops can prevent search engines from accessing page content and may negatively affect crawling and indexing.
How do I find which redirect is causing the loop?
Use browser developer tools or curl to inspect the redirect chain and identify repeated destinations.
Can redirect loops happen after changing hosting providers?
Yes. Old rewrite rules, incorrect application URLs and mismatched SSL or proxy configurations can introduce redirect loops after migration.
Should I disable Cloudflare to fix the error?
Not automatically. First review the SSL/TLS mode and redirect rules to identify the conflict.
Final Thoughts
The Too Many Redirects error usually occurs when a website repeatedly redirects visitors between conflicting URLs.
Common causes include incorrect Cloudflare SSL settings, duplicate .htaccess rules, inconsistent www redirects and application configuration problems.
The most effective solution is to identify the redirect chain and determine which component is creating the loop.
Start by checking SSL/TLS settings, reviewing .htaccess and confirming the application’s preferred website URL.
With consistent redirects and correct server configuration, your website can deliver visitors to the intended HTTPS address without unnecessary interruptions.
Need assistance with website hosting, SSL configuration or redirect problems? Explore Beta Host Limited’s Web Hosting Services or contact our technical support team.
