Redirect Loop Troubleshooting: A Step-by-Step Guide for HTTP, HTTPS, and www
redirect troubleshootingHTTPSCloudflareWordPressSEO migrations

Redirect Loop Troubleshooting: A Step-by-Step Guide for HTTP, HTTPS, and www

RRedirect Portal Editorial Team
2026-11-14
7 min read

Find and fix HTTP, HTTPS, and www redirect loops with a practical workflow for proxies, Cloudflare, WordPress, servers, and SEO migrations.

A redirect loop can make a migrated website inaccessible, prevent search engines from reaching pages, and hide the real cause behind a generic “too many redirects” message. This guide provides a safe, repeatable workflow for diagnosing HTTP-to-HTTPS and www redirect loops, checking reverse proxies, Cloudflare SSL settings, CMS configuration, cookies, and conflicting server rules, while keeping SEO migration changes controlled.

Overview

A redirect loop occurs when a browser is repeatedly sent between URLs without receiving a final page. Common examples include http://example.co.uk being redirected to https://example.co.uk, then sent back to HTTP, or https://www.example.co.uk being redirected to the non-www version while another rule sends the request back to www.

The browser eventually stops following the responses and may display ERR_TOO_MANY_REDIRECTS. A redirect checker may show the same pattern as repeated 301, 302, 307, or 308 responses. The status code matters, but the loop is usually caused by two systems disagreeing about the request: for example, a CDN sees HTTPS while the origin server sees HTTP, or a WordPress setting conflicts with a web-server rule.

During an SEO migration, do not solve the problem by adding more redirects at random. First establish the intended canonical URL, then trace every layer that can issue a response. A typical target might be one HTTPS, non-www URL format, such as https://example.co.uk/page. Every alternate version should reach that destination through one consistent path.

What to track

Record the full redirect path before changing configuration. Test the main hostname and representative URLs from the migration redirect map, including an old URL, a new URL, the www variant, the non-www variant, HTTP, HTTPS, a URL with a trailing slash, and a URL with query parameters.

SymptomLikely causeWhat to inspect
HTTP and HTTPS alternate repeatedlyConflicting transport rules or proxy protocol detectionOrigin redirect rules, forwarded protocol headers, CDN SSL mode, and application URL settings
www and non-www alternate repeatedlyTwo canonical-host rules point in opposite directionsDNS or hosting forwarding, Apache or Nginx rules, CDN rules, and CMS site URL settings
Only WordPress pages loopSite URL mismatch, redirect plugin, or cached application settingWordPress URLs, plugins, theme code, and server configuration
Only one browser loopsCached redirects, cookies, or browser-specific statePrivate browsing test, cookies, cache, and stored service-worker behaviour
Loop began after a CDN changeOrigin and edge disagree about encryption or hostnameSSL/TLS mode, origin certificate, edge rules, and forwarded headers
Loop affects only migrated pathsRedirect-map rule overlaps with a canonicalisation ruleRule order, pattern matching, destination URLs, and old-to-new mappings

Use a command-line request to expose each response. For example:

curl -I http://example.co.uk/page
curl -I https://www.example.co.uk/page
curl -IL --max-redirs 10 https://example.co.uk/old-page

The -I option requests headers, while -L follows redirects. Look for the status code, the Location header, and any headers identifying the layer that responded. If the final command repeats two or more locations, note the exact sequence. A browser’s developer tools can provide the same evidence in the Network panel; enable “Preserve log”, reload the page, and inspect each request rather than only the final error screen.

Cadence and checkpoints

Check redirects at four points in an SEO migration: before launch, immediately after DNS or routing changes, after the first configuration cleanup, and during a later monitoring review. A redirect loop can be introduced by a certificate renewal, a hosting move, a CMS or plugin update, a new CDN rule, or a change to the preferred hostname, so one successful pre-launch test is not enough.

1. Define one canonical destination

Write down the preferred protocol and host before editing rules. Decide whether the site will use HTTPS and www or HTTPS and non-www. Also decide how trailing slashes, uppercase paths, and default documents should be handled. This prevents separate teams or platforms from making contradictory assumptions.

2. Test the edge before the origin

Start with the public URL. If a CDN, load balancer, reverse proxy, or managed hosting platform is in front of the web server, it may issue the redirect before the request reaches the origin. Temporarily bypassing the edge, where safe and supported, can reveal whether the loop is created at the proxy or at the server. Do not expose an unprotected origin simply for testing; use the provider’s diagnostic method or a controlled internal route.

3. Check protocol detection

A frequent HTTP HTTPS redirect loop occurs when the browser connects securely to a proxy, but the proxy connects to the origin over HTTP. If the origin only checks its local connection, it may believe every request is insecure and redirect it to HTTPS again. Confirm that the proxy forwards the original protocol and that the application or server trusts that information only from the expected proxy.

Cloudflare and similar services can create this pattern when the edge-to-origin encryption mode does not match the origin’s certificate and redirect policy. Review the current SSL/TLS mode, origin certificate, “Always use HTTPS” setting, and any page or worker rules together. Change one setting at a time, then repeat the header test.

4. Check application and server rules

For WordPress, compare the WordPress Address and Site Address values, then review redirect plugins and cached settings. For Apache, inspect virtual-host configuration and .htaccess, including rewrite conditions and rule order. For Nginx, inspect server blocks and return or rewrite directives. A hosting control panel may add another domain-forwarding rule outside these files.

Back up configuration before editing it. Disable or change the smallest possible rule, test with curl, and keep a record of the previous value. If a migration uses bulk redirects, check that an old path points directly to its final new path rather than to an intermediate URL that then triggers hostname or protocol canonicalisation.

How to interpret changes

A fixed loop should produce a stable final response, normally a successful page response for the destination or one intentional redirect followed by that page. It should not rely on browser cookies, and the result should be consistent across HTTP, HTTPS, www, and non-www tests according to the canonical policy.

Separate a loop from a redirect chain. A chain moves through several different URLs and ends successfully; a loop returns to a previous URL. Both deserve attention during a migration, but the immediate priority is restoring a reachable final destination. After that, simplify chains so old URLs point directly to their final equivalents. Keep redirects that represent genuine content or domain changes, and avoid using a redirect to mask a missing or incorrectly mapped page.

Compare results from a private browser window, a normal session, and command-line tools. If only the normal session fails, clear relevant cookies and cached data after recording the evidence. If all clients fail, the cause is more likely to be server-side, proxy-side, or DNS-related. If the response differs by location or network, inspect CDN cache, load balancing, and split-DNS behaviour before changing application code.

For SEO, verify the final page’s canonical tag, internal links, XML sitemap entries, and hreflang references after the loop is fixed. A redirect should lead to the intended canonical page, not to a URL that declares a different canonical destination. Keep the redirect map and the test results together as part of the migration record.

When to revisit

Revisit redirect monitoring monthly during an active migration and at least quarterly once the site is stable. Repeat the review immediately after a DNS change, certificate renewal, hosting or CDN change, WordPress update, redirect-plugin change, domain consolidation, or unexplained increase in crawl or server errors.

Use a small repeatable test set rather than checking only the homepage. Include key landing pages, recently migrated URLs, old high-value URLs, both hostname variants, and both protocols. Store the date, request URL, status code, final URL, hop count, and response headers. A simple comparison makes it easier to spot a new loop after a configuration change.

When an incident occurs, follow this order:

  1. Record the exact URL and redirect sequence with a browser or curl.
  2. Confirm the intended canonical protocol and hostname.
  3. Identify whether the edge, origin server, CMS, or browser state issued the conflicting responses.
  4. Back up configuration and change one rule or setting at a time.
  5. Retest all URL variants and representative migration mappings.
  6. Check canonical tags, internal links, sitemaps, and monitoring after access is restored.

For related planning, see the redirect mapping template and pre-launch checklist, and review redirect rule order and precedence when multiple systems manage forwarding. Keeping these checks in the migration process turns a redirect loop from a disruptive surprise into a traceable configuration problem.

Related Topics

#redirect troubleshooting#HTTPS#Cloudflare#WordPress#SEO migrations
R

Redirect Portal Editorial Team

SEO and Redirects Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.