Forum Discussion
asabado
Altocumulus
Thanks SanjayP,
I did try out the irules but it didn’t seem to work.. ☹
SanjayP
Nov 04, 2021Nacreous
F5 has inbuilt gelocation database so this should work. I see there was 1 typo in iRule
(space between [IP::client_addr] country).
Please correct below and also enable some logging and provide the log output if still not working.
when HTTP_REQUEST {
switch -glob [whereis [IP::client_addr] country] {
"ES"
{
log local0. "ES IP match: [IP::client_addr]"
HTTP::respond 301 Location "https://www.abc.com/es-es/home/servicepoints.html"
}
"SE"
{
log local0. "SE IP match: [IP::client_addr]"
HTTP::respond 301 Location "https://www.abc.com/se-se/home/servicepoints.html"
}
default {
log local0. "no match: [IP::client_addr]"
HTTP::respond 301 Location "https://www.abc.com/home"
}
}
}