Forum Discussion
John_Giannone_4
Nimbostratus
Jun 09, 2008IRules for Redirection on GTM
We are currently using a GTM 1500 to redirect incoming web traffic based on Geographic locaiton. So when someone comes to our mainsite (for example) and they are from Australia, we serve them the IP ...
The_Bhattman
Nimbostratus
Jun 09, 2008I haven't ever written any iRules to take advantage of GTM
However, the general the rule of thumb is if get into 25 or more if-elseif statements to use the switch statements.
Example:
when DNS_REQUEST {
set wherefrom [whereis [IP::remote_addr]]
switch -glob $wherefrom {
"*US" { pool raileurope_us_pool }
"*AU" { pool raileurope_au_pool }
"*JP" { pool raileurope_jp_pool }
.
.
.
default { raileurope_us_pool }
}
}
Click here and/or Click here for more details about using "switch"
Hope this helps.
CB
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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