Redirect Types & Concepts

What is a geo redirect?

A geo redirect is a redirect rule that sends visitors to a different URL based on their geographic location. Instead of every visitor arriving at the same destination regardless of where they are in the world, a geo redirect detects where the request is coming from and routes visitors to a version of the site, or a specific page, appropriate for their location.

A visitor from France might be redirected to fr.example.com or example.com/fr. A visitor from Germany to de.example.com or example.com/de. A visitor from the United States stays on example.com. The content, language, currency, pricing, and product availability at each destination can be tailored to the specific market being served.

Geo redirects are one of the most powerful tools for international website management, and one of the most frequently misimplemented. Done correctly they deliver seamless localised experiences that improve conversion rates and user satisfaction. Done incorrectly they create duplicate content issues, redirect loops, and SEO problems that can be difficult to untangle. Understanding how geo redirects work, where they belong in an infrastructure stack, and how to configure them in a way that search engines can navigate correctly is essential for any site serving an international audience.

How a geo redirect works

Geo redirects work by detecting the geographic origin of an incoming request and applying redirect logic based on that location. The detection happens through one of several mechanisms.

IP geolocation: the most common method. Every device connecting to the internet has an IP address. IP addresses are assigned to geographic regions and the mapping between IP address ranges and locations is maintained in geolocation databases. When a request arrives, the server or CDN looks up the requesting IP address in a geolocation database and determines the country, region, or city it originates from. This lookup happens in milliseconds and is invisible to the visitor.

Browser language headers: browsers send an Accept-Language header with every request indicating the visitor’s preferred languages in order of preference. A visitor whose browser is set to French (fr) or German (de) can be redirected to the appropriate language version of the site based on this header without requiring IP geolocation. This approach detects language preference rather than physical location; a French speaker in Canada would be detected as a French language user rather than a Canadian location user.

CDN edge location data: modern CDN platforms like Cloudflare inject geographic information into request headers automatically based on the IP address of the incoming connection. The server receives these enriched headers and can apply redirect logic without performing its own geolocation lookup. Cloudflare’s CF-IPCountry header provides the two-letter country code of the visitor directly.

Once the location is determined the redirect logic routes the visitor to the appropriate destination: a country-specific subdomain, a language-specific path, a regional site, or in some cases a completely different domain for that market.

Geo redirect approaches

There are several architectural approaches to geo redirects, each with different implications for SEO, user experience, and implementation complexity.

Subdomain-based geo redirects: separate subdomains for each region or language: uk.example.com, de.example.com, fr.example.com. A visitor from Germany is redirected to de.example.com. Subdomain-based internationalisation is widely used and well-supported by search engines. Each subdomain is treated as a separate site that can be independently optimised for its target market and language.

Subdirectory-based geo redirects: language or region paths under the primary domain: example.com/uk, example.com/de, example.com/fr. A visitor from Germany is redirected to example.com/de. Subdirectory-based internationalisation keeps all international content under the primary domain, which consolidates domain authority in a single place. Google generally recommends subdirectories as the preferred structure for international content.

Country-code top-level domain redirects: separate ccTLDs for each country: example.co.uk, example.de, example.fr. A visitor from Germany is redirected to example.de. ccTLD-based internationalisation sends the strongest possible geographic targeting signal to search engines; a .de domain is an unambiguous signal that the content is intended for German users. The trade-off is maintaining separate domains with separate link-building and authority-building requirements for each.

Single domain with content switching: the URL does not change but the content served at that URL changes based on detected location. This is technically not a redirect; it is server-side personalisation, but achieves a similar outcome. The limitation from an SEO perspective is that search engines may index only one version of the content at the same URL rather than understanding that different versions exist for different audiences.

Geo redirects and SEO

Geo redirects introduce specific SEO challenges that do not exist with standard redirects. The core tension is that geo redirects are temporary redirects by nature, the same URL should show different content to different visitors, but search engines need to be able to crawl all versions of the content to index it correctly.

Use 302 not 301 for geo redirects: this is the most important SEO rule for geo redirects. A 301 permanent redirect tells search engines the original URL has moved permanently. If Googlebot, which typically crawls from US IP addresses, receives a 301 redirect from example.com to example.com/en, it will update its index to treat example.com/en as the permanent URL for all users. Visitors from Germany who should go to example.com/de will be served the English version after the cached 301 sends them there instead. Always use 302 temporary redirects for geo redirects to preserve the original URL as the canonical entry point.

Hreflang tags: the correct companion to geo redirects is the hreflang attribute, an HTML or HTTP header annotation that tells search engines which language and regional versions of a page exist and what the relationship between them is. Hreflang tags allow search engines to index each version of the content and serve the appropriate version to users in each region, complementing the geo redirect that routes live visitors while ensuring crawlers can access and index all versions.

Googlebot crawling: Googlebot crawls primarily from US IP addresses. If geo redirect logic redirects all US IP addresses to the US version of the site, Googlebot will only ever see the US version. The international versions will never be crawled and indexed. The solution is to exempt known crawler IP ranges from geo redirect logic or to use language-based detection that Googlebot can signal through its Accept-Language headers.

Duplicate content risk: multiple language or regional versions of the same content without proper hreflang annotations can appear to search engines as duplicate content. Hreflang tags resolve this by explicitly declaring the relationship between versions and helping search engines understand that the duplicates are intentional localised variants rather than unintentional repetition.

Geo redirects and user experience

Beyond SEO, geo redirects have significant user experience implications that are worth designing carefully.

Respecting user choice: one of the most common complaints about geo redirects is being forced to a localised version of a site the visitor did not want. A visitor from France who speaks English and prefers the English version of the site finds themselves redirected to the French version on every visit. The best implementations allow visitors to override the geo redirect, choosing their preferred language or region, and remember that choice in a cookie so subsequent visits respect it.

Language vs location: geo redirects based on IP address detect location, not language preference. A French speaker living in Canada has a Canadian IP address but may prefer the French version. A British expat living in Spain has a Spanish IP address but wants the English version. Using Accept-Language headers alongside IP geolocation, or offering an explicit language/region selector, produces a more accurate match between visitor preference and served content.

Transparency: visitors should understand why they have been redirected. A brief message acknowledging the redirect, “We have redirected you to your local version” with a link to the original, builds trust and reduces frustration. Silent redirects that move visitors without explanation feel broken to users who notice the URL has changed unexpectedly.

Performance: geo redirect logic adds processing time to every request. At the CDN or edge layer this overhead is minimal: milliseconds. At the origin server level, particularly with expensive geolocation database lookups on every request, the overhead can be more significant. Implementing geo redirects at the edge rather than the origin is the performance-correct approach.

Implementing geo redirects

Geo redirects can be implemented at several layers of the web infrastructure stack, each with different trade-offs.

CDN edge rules: the preferred implementation layer. CDN platforms like Cloudflare provide built-in IP geolocation and allow redirect rules to be defined at the edge, executing before requests reach the origin server. Cloudflare Workers, Cloudflare Redirect Rules, and similar edge computing tools can implement sophisticated geo redirect logic with minimal latency impact. Cloudflare provides the visitor’s country in the CF-IPCountry request header automatically.

Server-side application logic: geo redirect logic implemented in the web application using a geolocation library or API to look up the visitor’s location from their IP address. This is more flexible than CDN rules but adds origin server load and increases response time compared to edge-level implementation.

.htaccess with GeoIP module: on Apache servers with the mod_geoip or mod_maxmind module installed, geo redirect rules can be defined in .htaccess based on country codes injected by the module. This is a viable approach for smaller sites on traditional shared hosting.

Redirect management platforms: some redirect management tools support geo redirect rules, routing visitors from specific countries to different destinations, as part of their rule configuration. This abstracts the geolocation infrastructure into the redirect management layer.

Common geo redirect mistakes

Using 301 instead of 302: the most damaging geo redirect mistake. A 301 causes search engines and browsers to cache the redirect permanently, breaking the geo routing for all users after their first visit. Always use 302 for geo redirects.

Redirecting Googlebot away from the original content: if Googlebot is redirected to a region-specific version based on its US IP address, all other versions of the content may never be indexed. Implement crawler detection or use hreflang annotations to ensure all versions are accessible to crawlers.

No override mechanism: forcing visitors into a language or region version with no way to change it creates a poor experience and generates support complaints. Always provide a visible language or region selector and respect the visitor’s choice in a cookie.

Redirect loops between regional versions: example.com redirecting to example.com/de while example.com/de redirects back to example.com for non-German visitors creates a redirect loop for users changing regions. Design geo redirect logic to only fire on the root domain or entry point, not on the localised versions themselves.

Missing hreflang annotations: geo redirects without hreflang annotations leave search engines without the information they need to index and serve the appropriate version to users in each region. Hreflang and geo redirects should always be implemented together.

Related terms

Related terms

Ready to keep every link alive?

Ready to keep every link alive?

Ready to keep every link alive?