Practical guide

How to redirect website visitors by country without hurting SEO

Step by step: give each country its own URL, choose a tool or rule, set the redirect status, redirect once and check crawler handling and accuracy.

Last materially reviewed 2026-10-30

Quick answerGive each country version its own URL and hreflang tags first, add a visible country selector, then redirect by IP only if you still need to. Use a temporary status, redirect on the first visit only and test from several locations. A hosted tool, a Cloudflare rule or a server module can do the redirect.

Redirect website visitors by country: prepare the pages first

Start with the pages, not the redirect. Google's documentation recommends a separate URL for each country or language version, on a country domain, a subdomain or a subdirectory, with hreflang annotations or sitemaps that connect them. It also says to avoid automatically redirecting people by what you think their language is, and to link the versions so visitors can choose. A redirect is the last layer, for visitors who land on the wrong version.

This guide covers redirecting by country for a store with regional versions, a marketer with country landing pages or an agency managing several sites.

Steps in a safe order

  • Step 1: list the country versions and give each its own URL, such as a country domain, a subdomain or a subdirectory like example.com/uk/.
  • Step 2: connect them with hreflang annotations or sitemap entries so search engines can find every version.
  • Step 3: add a visible country or language selector on every page. Google says geotargeting is not an exact science and suggests links for visitors on the wrong version.
  • Step 4: choose how to redirect, with a hosted rules tool such as Geo Targetly or If-So, a Cloudflare redirect rule or a server module. Geo Targetly vs If-So and WordPress plugin options compare the tools.
  • Step 5: set the status. Google says permanent redirects show the new target in results and temporary redirects show the source page. Because one URL sends different visitors to different places, start with 302 or 307. If-So's guide calls 302 the safer default, and Cloudflare's country example sets 301, so read the status your rule sends.
  • Step 6: redirect once. Geo Targetly lists a first-visit-only setting and manual switchers, and If-So offers a once-per-visitor option that uses a cookie. Both stop visitors who chose another version from being sent back.
  • Step 7: decide on crawlers. Google says to treat its crawler like any user from the country it appears to come from, and that it crawls from the US and from other countries. Geo Targetly and Advanced GeoIP Redirect list settings that skip bots, while Geo Targetly's own SEO guide says not to disable redirects for Google's crawler. Pick one rule and apply it the same way in every country.
  • Step 8: test from several locations and with a cold and a warm cache. Geo Targetly's Test Mode simulates visits from other locations, and If-So advises a VPN or a location override tool.

The Cloudflare route in brief

If the site already runs through Cloudflare, a Single Redirect rule can test the visitor's country with the ip.src.country field, which holds a two-letter ISO 3166-1 Alpha 2 code. Single Redirects are available on every plan, with 10 rules on Free and 25, 50 and 300 on Pro, Business and Enterprise, and regular expressions on Business and Enterprise. Cloudflare's example sends United Kingdom and France visitors from the root path to country subdomains with a 301. Cloudflare also says IP geolocation is an estimate and should not be the only signal for compliance-critical rules.

Accuracy, tests and what each route costs to run

  • Accuracy: Geo Targetly states 99 percent at country level, 80 to 90 percent at state level and 70 to 80 percent at city level. MaxMind estimates 99.8 percent for country, about 80 percent for US states and 66 percent for US cities within 50 km, and says that for a visitor on a VPN it can at best locate the VPN server. These are vendor figures.
  • Hosted tool: Geo Targetly meters pageviews, and If-So meters geo sessions, 250 a month on its free plan. See Geo Targetly pricing.
  • Cloudflare: redirect rules are included on every plan up to the rule limit above.
  • Server module: the nginx geoip module reads MaxMind databases but is not built by default and needs a library. MaxMind's free GeoLite data needs an account and license key, must be kept updated under its license, and its city data is described as considerably less accurate than paid data. Count the engineer time.

Next step

Compare tools in geo redirect WordPress plugins, or read the Geo Targetly review if a hosted tool looks right.

Continue when useful

Next: Geo redirect plugins

Four geo redirect WordPress plugins and a no-plugin route compared from their own listings: location source, redirect types, caching and how each bills.

Open Geo redirect plugins →

Sources used for this page

These records support the facts and comparisons above. Merchant-controlled records are labelled so you can separate product claims from independent evidence.

  1. Google Search Central: managing multi-regional and multilingual sites — Platform documentation · developers.google.com · Merchant-controlled · checked 2026-10-30
  2. Google Search Central: how Google crawls locale-adaptive pages — Platform documentation · developers.google.com · Merchant-controlled · checked 2026-10-30
  3. Google Search Central: redirects and Google Search — Platform documentation · developers.google.com · Merchant-controlled · checked 2026-10-30
  4. Geo Targetly Geo Redirect product page — Merchant documentation · geotargetly.com · Merchant-controlled · checked 2026-10-30
  5. Geo Targetly guide to redirection and geolocation SEO — Merchant documentation · geotargetly.com · Merchant-controlled · checked 2026-10-30
  6. How to set up a geo redirect with If-So — Alternative provider · if-so.com · Publisher independence not verified · checked 2026-10-30
  7. Advanced GeoIP Redirect plugin listing, WordPress.org — Platform documentation · wordpress.org · Merchant-controlled · checked 2026-10-30
  8. Cloudflare Redirects documentation, availability and quotas — Platform documentation · developers.cloudflare.com · Merchant-controlled · checked 2026-10-30
  9. Cloudflare example: redirect local visitors to specific subdomains — Platform documentation · developers.cloudflare.com · Merchant-controlled · checked 2026-10-30
  10. Cloudflare IP geolocation documentation — Platform documentation · developers.cloudflare.com · Merchant-controlled · checked 2026-10-30
  11. Cloudflare ip.src.country field reference — Platform documentation · developers.cloudflare.com · Merchant-controlled · checked 2026-10-30
  12. MaxMind knowledge base: geolocation accuracy — Platform documentation · support.maxmind.com · Merchant-controlled · checked 2026-10-30
  13. MaxMind developer portal: GeoLite databases — Platform documentation · dev.maxmind.com · Merchant-controlled · checked 2026-10-30
  14. nginx documentation: ngx_http_geoip_module — Platform documentation · nginx.org · Merchant-controlled · checked 2026-10-30
  15. Geo Targetly pricing page — Merchant documentation · geotargetly.com · Merchant-controlled · checked 2026-10-30
  16. If-So plans and features page — Alternative provider · if-so.com · Publisher independence not verified · checked 2026-10-30