Forum Discussion
Eric_St__John
Feb 25, 2014Employee
What you are doing in your current iRule would not be considered a "redirect", but URI switching. The following iRule would match an IP address against the data group "data_group_name", and if it matches it will go through the rest of your logic. If it does not match an IP in the data group "data_group_name", it will redirect to http://maintenance.domain.com If you are looking to perform a pool selection based on the IP address rather than redirect, you can change the else action.
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals data_group_name] } {
switch -glob [string tolower [HTTP::uri]] {
"/jumper" {
pool jumper_JMPRIIS_Https_Pool
log local0. "redirect irule pool jumper_JMPRIIS_Https_Pool"
}
"/" -
"/annie" -
"/bugg" -
"/charles" -
"/dog" -
"/fashion" {
pool fashion_FHSIIS_Https_Pool
log local0. "redirect irule pool fashion_FHSIIS_Https_Pool"
}
default {
pool skijump_SKJWEB_Https_Pool
log local0. "redirect irule pool skijump_SKJWEB_Https_Pool"
}
}
else {
HTTP::redirect "http://maintenance.domain.com"
}
}
}
Eric