Forum Discussion
Anesh
Jun 20, 2018Cirrostratus
try
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.example.com" && [HTTP::path] eq "/" }{
set client_ip [IP::client_addr]
set country [string tolower [whereis $client_ip country]]
switch $country {
"us" -
"uk" -
"ca" {
HTTP::redirect "https://example.com/${country}"
}
}
}
}