Forum Discussion
Neil_66348
Nimbostratus
Nov 09, 2010iRule GeoIP Targeting
Hi Guys ,
We're looking to implement some targeting thats found in 10.2 on our F5's.
Performing matching at the IP level works fine , I've found some example code for matching to t...
naladar_65658
Altostratus
Nov 09, 2010I am not certain but it looks like to me you are setting your state to equal the two letter abbreviation in the iRule. But you want to actually return the word, not the two letter abbrev so using state instead of abbrev in the iRule and I think this should work:
when HTTP_REQUEST {
set state [class match -value [whereis [IP::client_addr] state] equals uk_regions]
if {$state ne ""}{
switch $state {
"Greater London" {HTTP::redirect http://62.190.x.x/ab/grlon/}
"Leeds" {HTTP::redirect http://62.190.x.x/ab/leeds}
"York" {HTTP::redirect http://62.190.x.x/tv/York/}
default {pool TIN-HTTP-POOL}
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects