Forum Discussion
Bryce_Halkerst1
May 08, 2013Nimbostratus
All,
Meant to update the resolution a while back. Worked with Aaron to finalize the irule, we had to disable http classes and update the syntax.
Thanks,
Bryce
Final working irule configuration:
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri] contains prod -> [class match -value -- [HTTP::uri] contains datagroup301s]"
if {[set code_url [class match -value -- [string tolower [HTTP::host][HTTP::uri]] equals datagroup301s]] ne ""}
{
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting [HTTP::uri] to ([getfield $code_url " " 1]) [getfield $code_url " " 2]"
HTTP::class disable
HTTP::respond [getfield $code_url " " 1] Location [getfield $code_url " " 2]
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: No match for [HTTP::uri] in datagroup301s"
HTTP::class enable
}
}