# Country based redirection from a proxied domain

**URL:** <https://answers.netlify.com/t/country-based-redirection-from-a-proxied-domain/42141>\
**Category:** Support\
**Tags:** redirects\
**Created:** [August 7, 2021, 12:40pm UTC](https://answers.netlify.com/t/country-based-redirection-from-a-proxied-domain/42141 "2021-08-07T12:40:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishal.deep](https://avatars.discourse-cdn.com/v4/letter/v/fbc32d/32.png) [@vishal.deep](https://answers.netlify.com/u/vishal.deep)\
**Post date:** [August 7, 2021, 12:40pm UTC](https://answers.netlify.com/t/country-based-redirection-from-a-proxied-domain/42141/1 "2021-08-07T12:40:01Z")

</div>

- Site name: `site-agicap-com-production.netlify.app`
- Domain: [agicap.com](http://agicap.com)

We have a site that is translated into multiple languages. We have set the redirection based on the Country which is working properly on the Netlify domain (site-agicap-com-production.netlify.app). The main domain ([agicap.com](http://agicap.com)) is linking with the Netlify domain behind a proxy, because of which the redirection is not working.

Is there anything we can pass to Netlify along with the request from the main domain so that the redirections work properly? Can we use the `X-Forwarded-For` header for this?

Any help will be highly appreciated.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 9, 2021, 10:53am UTC](https://answers.netlify.com/t/country-based-redirection-from-a-proxied-domain/42141/2 "2021-08-09T10:53:50Z")

</div>

Hi @vishal.deep,

You can use the cookie to redirect: [Redirect options | Netlify Docs](https://docs.netlify.com/routing/redirects/redirect-options/#redirect-by-country-or-language).

---

<div class="post-metadata">

**Author:** ![vishal.deep](https://avatars.discourse-cdn.com/v4/letter/v/fbc32d/32.png) [@vishal.deep](https://answers.netlify.com/u/vishal.deep)\
**Post date:** [August 9, 2021, 11:12am UTC](https://answers.netlify.com/t/country-based-redirection-from-a-proxied-domain/42141/3 "2021-08-09T11:12:19Z")

</div>

Hi @hrishikesh, thank you for your response.

We are already using cookie-based redirection when the user selects a language from the language dropdown.

The issue is that the user then has to explicitly select the desired language. We are hoping to redirect the users to their country page automatically.

Is there any way we can leverage the GeoIP based redirection that Netlify supports out-of-the-box?

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 9, 2021, 11:16am UTC](https://answers.netlify.com/t/country-based-redirection-from-a-proxied-domain/42141/4 "2021-08-09T11:16:22Z")

</div>

Hi @vishal.deep,

Unfortunately, when you proxy to Netlify, we can see the IP address of the proxying agent and not the actual user. Thus, the location based redirect won’t work with proxy as it relies on IP address.

The only other way would be to ask the user for language preferences on initial website load and save it in a cookie.
