How do I configure country-based redirects on Netlify?

The Citead team, updated

In short. Configure a Country condition in _redirects or netlify.toml, account for rule order and existing files, and keep locale URLs directly accessible.

Definition: A country-based redirect on Netlify sends a matching request to another URL using a Country condition. As of 17 October 2026, Netlify matches the visitor's country using GeoIP data, which associates an IP address with a location, or an nf_country cookie that overrides the default behavior.

Key facts

  • Netlify's Redirect options documentation supports Country conditions with ISO 3166-1 alpha-2 country codes, such as au,nz for Australia and New Zealand.
  • Netlify's redirects overview places _redirects in the site's publish directory, the folder containing the finished files deployed after the build.
  • Google's locale-adaptive crawling guidance, updated 10 December 2025, says Googlebot's default IP addresses appear US-based and its requests omit Accept-Language.
  • Google's multilingual site guidance recommends separate URLs for language versions and links that let visitors choose another version.

What configuration belongs in the redirect file?

Netlify's Redirect options documentation gives a rule that sends visitors in Australia or New Zealand from / to /anz. The following adaptation adds ! to force the redirect even when a homepage file exists:

/  /anz  302!  Country=au,nz

The fields are the original path, destination, HTTP status code and country condition. 302 marks a temporary redirect. Netlify defaults to 301, a permanent redirect, when the status is omitted. Comma-separated country values have no spaces inside the condition.

Netlify's configuration syntax also supports country conditions in netlify.toml. The equivalent configuration is:

[[redirects]]
from = "/"
to = "/anz"
status = 302
force = true
conditions = { Country = ["au", "nz"] }

These are alternative representations of the same rule. The example matches the root path; its destination /anz falls outside that source path. The force setting overrides existing content at a matching path.

How do rule order and visitor choice affect routing?

Netlify's rule processing documentation specifies that the first matching rule wins, reading from top to bottom. It processes _redirects before netlify.toml. Country-specific rules therefore belong before any general redirect for the same source path. An earlier unconditional rule can take precedence over a country condition defined later, including one in the other file.

Netlify's country and language options distinguish GeoIP country matching from browser language matching. The nf_country cookie overrides the country default, while nf_lang controls the language default. A region selector can use the country override to retain an explicit visitor choice. Selecting a country and selecting a language require separate decisions in the site's routing design.

What are the implications for locale URLs and crawling?

A locale version is a page intended for a particular language or region. Google's locale-adaptive page documentation warns that content selected by perceived country or preferred language may receive incomplete crawling and indexing across locales. It recommends separate locale URLs with hreflang annotations, which identify alternate language or regional versions.

Google's multilingual site guidance advises against automatically redirecting visitors between language versions based on an assumed preference. It recommends hyperlinks to other versions. For the root-only Netlify example, a practical application of that guidance is to keep regional destination URLs directly accessible and provide a region or language selector. Any automatic routing remains an entry-point choice; the alternate pages also have their own URLs and links.

FAQ

Why does my country rule leave the homepage unchanged?

Netlify's force-redirect documentation explains that an existing file can take precedence over a redirect. You can append ! to the status in _redirects or set force = true in netlify.toml when the redirect should override that content.

Can visitors choose a different country?

Yes. The same Netlify documentation identifies nf_country as the cookie for overriding default country behavior. You can use it when implementing a region selector.

Does a country condition select the browser's language?

The same Netlify documentation provides a separate Language condition for that purpose. Language rules match the first language in the browser's Accept-Language header, regardless of quality-value weighting.

Sources

  1. Netlify, "Redirect options", updated 17 September 2026
  2. Netlify, "Redirects and rewrites", updated 14 July 2025
  3. Google Search Central, "How Google crawls locale-adaptive pages", updated 10 December 2025
  4. Google Search Central, "Managing multi-regional and multilingual sites", updated 10 December 2025

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark