Forum Discussion
Lee_Sutcliffe
Oct 17, 2017Nacreous
I would probably put all your URIs in a datagroup and use a second 'if' statement rather than a switch statement. This way you can add more URIs without changing the code. Also, if you just want to send traffic to another Virtual server, you can use the 'virtual' command rather than a redirect - unless a redirect is your requirement.
If you set a default pool in in your virtual server, you don't need to specify it in the iRule.
when HTTP_REQUEST {
set lowCaseURI [string tolower [HTTP::uri]]
if {[HTTP::host] equals "1.1.1.1"} {
if {[class match $lowCaseURI starts_with your-uri-dg]} {
virtual name-of-your-vs
}
}
}