Hi,
I would just change [HTTP :: path] to [HTTP :: uri] to not lose querystring values when there and discard connections instead of reject.
Anyway, an LTM policy works fine in this case and I may prefer to use it.
Finally, my iRule code should be:
when HTTP_REQUEST {
set host [string tolower [getfield [HTTP::host] : 1]]
if { [class match [IP::client_addr] equals datagroup_abc] } {
pool Pool_abc
} elseif { $host eq "abc.co.in" ||
$host eq "www.abc.prod.co.uk" ||
$host eq "192.168.168.10" } {
HTTP::respond 301 -version auto noserver Location "http://www.abc.co.in[HTTP::uri]" Connection Close
} else {
discard
}
unset host
}
Regards.