Vishal_96707
Mar 03, 2009Nimbostratus
Bypass iRule for specific IP
I have following iRule configured for sharepoint app which redirects to a different site when you get "404" or "File Not Found" error. I want to have a configuration in which the certain ip will bypass the iRule. Even if this specific ip gets "404" or "File Not Found" it is OK.
Also how do you use IP address match in HTTP request? I believe i will have to use TCP events.
when HTTP_REQUEST {
set MYHOST [HTTP::host]
set MYURI [HTTP::uri]
}
when HTTP_RESPONSE {
log local0. "HTTP Status code is [HTTP::status] and Content Length is ([HTTP::header value "Content-Length"])"
if {([HTTP::status] == 404)} then {
log local0. "Found HTTP Status [HTTP::status] and the uri is $MYHOST $MYURI Redirecting"
HTTP::redirect "url"
} elseif { ([HTTP::payload] contains "File Not Found") or ([HTTP::payload] contains "404 NOT FOUND") } then {
log local0. "Page Content: [HTTP::payload]"
HTTP::redirect "url"
}
}