Redirect to for IPs from country A

Hello and wondering how to redirect correctly for to if users browse from country A.

Appreciate for any detailed instructions such as which field, operator, value, redirect type, url to redirect to, code 30x and Preserve query string or not.



Please see this answer to a similar topic.

1 Like

Thank you for your reply but I was not able to get it worked. What would be the correct rules for:

Appreciate any help.

Please post exactly what you tried, and what didn’t work. (Too many redirects? Didn’t detect country properly? etc.) Post screenshots of any error messages.

I tried this and it gave “redirect to many times” error:
( eq “” and eq “US”)
then static redirect to (not Preserve query string)

I tried this (with /) and it did not redirect:
( eq “” and eq “US”)
then static redirect to (not Preserve query string)

Pls help

The hostname ( does not include “/”, which is a path element. So the first expression is right. To avoid the redirect loop you need to exclude requests that have already been redirected, as shown in the example I gave you.

and not starts_with(http.request.uri.path, "/us")

Thank you! So here is the settings I got:
( eq “” and not starts_with(http.request.uri.path, “/us”) and eq “US”) then static redirect to '
It seems to work but then any visit to ' other than /us redirected to /us. Is there any other settings that can help redirect as above but still able to visit any other page on '

Do you want visits to to be redirected for US visitors to

Or do you want only the homepage to redirect for US visitors?

I want only the homepage redirected to /us for us visitors and same for any other countries. And visitors (anywhere) can visit any page or ', for example US visitors when visiting the homepage will be redirected to ' but if they are able visit '
Thanks so much,

Change the initial condition from eq ""


http.request.full_uri eq ""

That should make the Redirect Rule apply only to the homepage.

BOOM!!! You’re gold and thank you so much!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.