Forum Discussion

eliton_199802's avatar
eliton_199802
Icon for Nimbostratus rankNimbostratus
Aug 24, 2018

iRule to redirect to URLs

Hi All,

I am in need of an iRule that redirects users to URLs based on their source IP. I am attaching it to a standard VS with no pool defined. This is what I have come up with, however it does not seem to do the trick. All I get is a connection reset.

when HTTP_REQUEST { if { ( [IP::addr [IP::client_addr] equals 10.50.1.0/24] ) } { HTTP::redirect "; }

if { ( [IP::addr [IP::client_addr] equals 10.60.1.0/24] ) } {
    HTTP::redirect "http://abc2.test.com"
}
if { ( [IP::addr [IP::client_addr] equals 10.70.1.0/24] ) } {
    HTTP::redirect "http://abc3.test.com"
}

}

4 Replies