unless you’re using HTTP/1.0 without keep-alive sessions, then it would be more effective to evaluate the Client IP during the CLIENT_ACCEPTED event (triggered once at the beginning of each TCP session), store the
[class match]
results into a
$variable
and the use the stored results on each single HTTP_REQUEST.
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals my_ip_dg] } {
set is_redirect 1
} else {
set is_redirect 0
}
}
when HTTP_REQUEST {
if { $is_redirect } then {
if { [string tolower [HTTP::path]] equals "/somepath" } then {
HTTP::redirect "http://10.200.200.200"
}
}
}
Note: Feel free to combinate theandconditions. I’ve splitted them just for demonstration purposes.