Forum Discussion
Kai_Wilke
Dec 17, 2015MVP
Hi Jace,
iRules evalutes your conditions in a first-match order.
So either make sure you'll use a collision free conditions set by using "equals" operators (as Stephan already recommended), or evaluate the most restrictiv "starts_with" condition first and the continue to evaluate the less restrictive "starts_with" condition (see snippet below).
when HTTP_REQUEST {
set low_uri [string tolower [HTTP::uri]]
if { $low_uri starts_with "/abc1" } then {
Allow the request
} elseif { ( $low_uri starts_with "/abc" ) and not ( [class match [IP::client_addr] equals private_net] ) } then {
reject
}
}
Cheers, Kai