Direct Answer

A country redirect reads the visitor's IP location and sends, for example, visitors in Germany to mybrand.com/de. You can set it up today with a CDN or server rule (examples below). In RedirHub, country routing is available on request: contact us and it can be turned on for your workspace in as little as 3 days.

This example at a glance
ItemDetails
GoalVisitors from Germany and Austria land on /de, from France on /fr, everyone else on the default page
Redirect type302 Temporary, because the target depends on the visitor
Watch out forSearch engine crawlers, VPN users and travellers

Keep country redirects SEO-safe#

  • Give every country version its own URL and connect them with hreflang tags.
  • Redirect only the entry point (for example the homepage or a campaign link), not every page, so search engines, which mostly crawl from the US, can still reach every version.
  • Use a 302, and let visitors switch country with a visible link that isn't redirected again.

Set it up with Cloudflare#

In Rules, create a Redirect Rule with a custom filter expression, a static target URL and status code 302:

textWhen incoming requests match:
  (http.host eq "mybrand.com" and http.request.uri.path eq "/" and ip.src.country in {"DE" "AT"})
Then: Static redirect to https://mybrand.com/de/ with 302

Set it up with Nginx#

nginxgeoip2 /etc/nginx/GeoLite2-Country.mmdb {
    $country_code country iso_code;
}

map $country_code $country_path {
    default "";
    DE      /de/;
    AT      /de/;
    FR      /fr/;
}

server {
    server_name mybrand.com;
    location = / {
        if ($country_path) {
            return 302 https://mybrand.com$country_path;
        }
        # otherwise serve the default homepage
    }
}

This needs the ngx_http_geoip2_module and a country database such as MaxMind GeoLite2.

Country routing in RedirHub (on request)#

If your domains already redirect through RedirHub, country routing can be turned on for your workspace so one link sends each country to its own destination, with the same analytics, HTTPS and 130 Global PoPs as your other redirects. It is set up on request and can be live in as little as 3 days.

To request it, use the contact form or email success@redirhub.com with your workspace name, the source links and the country-to-destination list.

Need country routing on RedirHub? Tell us which links and countries you need. It can be live in as little as 3 days.

Request country routing

For the background on geo redirects and SEO, read Geo Redirects: How to Redirect Visitors by Country.

Frequently asked questions

Country routing is available on request. Contact us through the contact form or success@redirhub.com, and it can be turned on for your workspace in as little as 3 days.

A 302. The destination depends on who is visiting, so it isn't a permanent move, and a 302 keeps search engines from replacing the original URL.

It can, if every page redirects by IP, because Google mostly crawls from the US. Redirect only the entry point and link the versions with hreflang.

Related help

View All Articles