Forum Discussion
Michael_Yates
Jun 10, 2011Nimbostratus
Try this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"*XXX*" {
if { !([matchclass [IP::client_addr] equals $::XXX_access_list]) } {
HTTP::redirect https://MyXXXUnauthPage.com
}
}
"*YYY*" {
if { !([matchclass [IP::client_addr] equals $::YYY_access_list]) } {
HTTP::redirect https://MyYYYUnauthPage.com
}
}
"*ZZZ*" {
if { !([matchclass [IP::client_addr] equals $::ZZZ_access_list]) } {
HTTP::redirect https://MyZZZUnauthPage.com
}
}
}
}
Your not comparison (can also be expressed by "!"), needs to be inside of your if statement and needs to be applied to the entire comparison.
Comparison: [matchclass [IP::client_addr] equals $::ZZZ_access_list]
Comparison: !(results of first comparison)
Result: if false, do this....