Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Geo-redirect loop: how to find and fix it

CNV-340High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

A geo-redirect sends visitors to a country or language version of your site based on their location (their IP address) or browser language. A geo-redirect loop is when that logic contradicts itself. Site A says 'this visitor is in Germany, go to /de/'. Site B or a second rule says 'this visitor asked for /de/ but is on an English-language browser, go to /en/'. The two keep passing the visitor back and forth.

Why it costs you leads or sales

Affected visitors cannot reach your site, so they cannot fill in a form, add to cart or check out. Because the loop depends on location, language or cookies, it often hits only some visitors, such as travellers, people on a VPN, or one country. You may not see it yourself. Paid traffic is especially exposed: you pay for the click and the visitor sees an error.

How a geo-redirect loop eats a visit
  1. Ad clickVisitor from Germany lands on /
  2. Redirect to /de/Geo rule fires
  3. Redirect back to /Language rule disagrees
  4. Landing pageNever loads
  5. Form or checkoutNever reached

The visitor never reaches the landing page, so every step after the redirect is lost.

Visits that reach the pageExample numbers
Visits that reach the page (example)Unaffected countries: 100 %; Affected country: 0 %038771000Unaffected countriesAffected country%

Example: of 100 visitors from one affected country, none load the page while the loop is live. Other countries are unaffected.

How to check if your site has it

Trace the redirect chain
  1. Test the URL with curl

    Run curl -IL --max-redirs 10 https://example.com/ and read the Location headers. If the same two URLs repeat, you have a loop.

  2. Test with a clean browser

    Open a private window with no cookies and load the site. Then clear cookies and try again, since some loops only happen with or without a country cookie.

  3. Simulate other locations

    Use a reputable VPN or your browser's language setting to test from the affected country and language. Do not use anything that breaks a service's terms.

  4. Check the network tab

    In Chrome DevTools open Network, tick Preserve log, and load the page. Repeated 301 or 302 responses show which rule sends the visitor where.

  5. Look at each redirect layer

    List every place that can redirect: CDN or DNS rules, server config, CMS plugin, theme code and app scripts.

Follow redirects and print each hopbash
curl -sIL --max-redirs 10 -H 'Accept-Language: de-DE' https://example.com/ | grep -iE '^(HTTP|location)'

How to fix it

The principle is the same everywhere: redirect only when the visitor is not already on the right site, only once, and never override a choice they made themselves.

Fix the loop
  1. Find which two rules conflict

    Use the redirect trace to name the URLs and the layer that issues each one.

  2. Keep one layer in charge

    Turn off duplicate geo or language redirects so only one system decides.

  3. Skip if already on the target

    Add a condition: do not redirect when the path already starts with the target country or language folder.

  4. Remember the visitor's choice

    Set a cookie when a visitor picks a site or is redirected once, and do not redirect again while it exists.

  5. Exclude bots, assets and key paths

    Do not redirect crawlers, static files, checkout or API paths, which can also trigger loops.

  6. Use a suggestion banner where possible

    A 'Switch to the German site?' banner avoids forcing visitors and can't loop.

Where to change it on your platform
  1. Check plugins

    Deactivate geo, language and redirect plugins one at a time (for example your multilingual plugin and any redirect or geolocation plugin) and retest after each.

  2. Review language settings

    In your multilingual plugin's settings, check the browser-language redirect option and the URL format (directory, subdomain or domain), and make sure the homepage for each language is not redirecting to another.

  3. Check Settings > General

    Make sure WordPress Address and Site Address match, including http or https and www.

Client-side redirect that cannot loopjavascript
(function () {
  var target = '/de/';
  var hasChoice = document.cookie.indexOf('site_choice=') !== -1;
  var alreadyThere = location.pathname.indexOf(target) === 0;
  if (hasChoice || alreadyThere) return;
  // userCountry comes from your geo service
  if (window.userCountry === 'DE') {
    document.cookie = 'site_choice=de; path=/; max-age=31536000; SameSite=Lax';
    location.replace(target + location.pathname.replace(/^\//, '') + location.search);
  }
})();
Server redirect with cookie and path guardsnginx
# $geo_country must be set by your geo module
map $http_cookie $has_choice {
  default 0;
  ~*site_choice= 1;
}
server {
  location = / {
    if ($has_choice = 0) {
      set $go "";
    }
    if ($geo_country = DE) { set $go "${go}de"; }
    if ($has_choice = 0) { set $go "${go}"; }
    if ($go = de) { return 302 /de/; }
  }
}

How to confirm it's fixed

Confirm the fix
  • curl with --max-redirs 10 ends in a 200 response, not a repeating pair of URLs
  • A private window with no cookies loads the page from the affected country and language
  • Choosing a country manually sticks and does not bounce back
  • Clearing cookies and reloading still works
  • Query parameters such as utm_source and gclid are still in the final URL
  • The form or checkout on the final page loads and submits

How to prevent it happening again

Prevention habits
  • Keep one system responsible for geo and language redirects
  • Document every redirect layer: CDN, server, CMS, plugin, tag manager
  • Always add a cookie check and an already-on-target check
  • Re-test after changing domains, https, www settings, plugins or markets
  • Test from each target country and browser language after releases
  • Prefer a suggestion banner over forced redirects

How FunnelGuard handles this

FunnelGuard detects this issue. Its robot visitor loads your pages on a schedule from the EU or the US and follows the redirects it meets, which is the redirect check. If a page bounces between URLs or never settles, the journey fails at that step. A failure is re-checked from a second region before one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause.

The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month with a 3-day free trial, and a free read-only website audit is available.

Questions people ask

Why does my website say 'too many redirects'?

Two or more redirect rules are sending the visitor back and forth, so the browser gives up after a set number of hops. With country or language sites, this is often a geo rule and a language rule disagreeing, or a CDN and a plugin both redirecting.

What is a geo-redirect loop?

It is a loop where a location-based redirect sends a visitor to a country version of your site and another rule sends them back. The page never loads and the browser shows an error such as ERR_TOO_MANY_REDIRECTS.

How do I find what is causing a redirect loop?

Run curl -IL --max-redirs 10 on the URL and read the Location headers, or use the Network tab in Chrome DevTools with Preserve log on. The repeating URLs show which rules conflict, and the response headers hint at which layer sent each one.

Why does the redirect loop only happen for some visitors?

Geo rules depend on location, language and cookies. A loop can affect visitors from one country, people with a certain browser language, or those with or without a stored country cookie, which is why you may not see it yourself.

How do I stop a country redirect from looping?

Redirect only when the visitor is not already on the target URL, set a cookie after the first redirect and skip redirecting when it exists, and keep a single system in charge of the rule. Use a temporary 302 redirect.

Should I use a 301 or 302 for a geo-redirect?

Use a 302, because the destination depends on who is visiting. Browsers cache 301 redirects, so a visitor can keep being sent to the wrong site even after you fix the rule.

Does a geo-redirect loop hurt SEO?

It can. Search engine crawlers that hit a loop cannot load the page, and forced redirects based on location can stop them seeing all language versions. Let crawlers reach each version directly and use a banner for visitors.

Can FunnelGuard detect a geo-redirect loop?

Yes, for the locations it checks from. It follows redirects on your journeys from the EU or the US and alerts you with a screenshot and likely cause if a page does not settle. It does not test every country.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: redirects.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.