The hostname (http.host) 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.
Thank you! So here is the settings I got:
(http.host eq “domain.com” and not starts_with(http.request.uri.path, “/us”) and ip.geoip.country eq “US”) then static redirect to 'https://domain.com/us
It seems to work but then any visit to 'domain.com/page 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 'domain.com?
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 'sub.domain.com, for example US visitors when visiting the homepage will be redirected to 'domain.com/us but if they are able visit 'domain.com/any-page.
Thanks so much,