iRule Geo Targeting
Hi Guys ,
Trying to the below to work , TCL is not my strong point...
when HTTP_REQUEST { if { ([string tolower [HTTP::uri]] starts_with "/geo") } { Parse the client IP from X-Forwarded For as Client IP is proxied. set client_ip [HTTP::header value "X-Forwarded-For"] if { $client_ip eq "" }{ set state [class match -value [whereis [IP::client_addr] state] equals uk_regions] } switch $state { Leeds {HTTP::redirect http://62.190.1.1/ab/leeds} York {HTTP::redirect http://62.190.1.1/ab/york} grlond {HTTP::redirect http://www.google.com/news} default {pool DEV-HTTP-POOL} } } } } }
The code doesn't compile with an error , effectively the iRule needs to fire /geo and then redirect based upon their incoming x-forwarded for.
Thanks Neil