Can someone assist- my IRule is not working correctly.
basically:
if you are part of the address_datagroup & you are accessing URI in the uri_datagroup =allow access
if you are not part of the address_datagroup & you are accessing URI in the uri_datagroup=redirect
when HTTP_REQUEST {
log local0. "client IP is [IP::client_addr]"
if { [matchclass [IP::client_addr] eq address_datagroup] } {
if { [string tolower [HTTP::host]] equals "XX.XXX.com" and [matchclass [string tolower [HTTP::uri]] starts_with XX_XXX_com_uri_datagroup] } {
HTTP::redirect "http://XX.XXX.com"
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to "
} elseif { [string tolower [HTTP::host]] equals "XX.XXX.com" and [matchclass [string tolower [HTTP::uri]] starts_with www_newark_com_uri_datagroup] } { HTTP::redirect
http://XX.XXX.com
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to http://xx.xxx.com"
} elseif { [string tolower [HTTP::host]] equals "xx.xxxx.com" and [matchclass [string tolower [HTTP::uri]] starts_with www_xxx_com_uri_datagroup] } { HTTP::redirect "http://xx.xxx.com" }
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to
http://xx.xxx.com"
} elseif { [string tolower [HTTP::host]] equals "xx.xxxcom" and [matchclass [string tolower [HTTP::uri]] starts_with www_xxxxxcom_uri_datagroup] } { HTTP::redirect "http://xx.xxxx.com"
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to
http://xx.xxxx.com" } }