Forum Discussion
RaghavendraSY_7
Oct 23, 2017Cumulonimbus
You can try with below irule and you can tweak according to your requirement. when HTTP_REQUEST { if {([HTTP::host] equals "; ) } { pool pool1 } elseif { ([HTTP::uri] starts_with "/dev")} { pool pool2 } elseif { ([HTTP::uri] starts_with "/qa")} { pool pool3 } elseif { ([HTTP::uri] starts_with "/test")} pool pool4 } }
Hope this helps.
- Kevin_DaviesOct 23, 2017MVP
when HTTP_REQUEST { if {[HTTP::host] equals "https://apps.mydomain.com"} { pool pool1 } elseif {[HTTP::uri] starts_with "/dev"} { pool pool2 } elseif {[HTTP::uri] starts_with "/qa"} { pool pool3 } elseif {[HTTP::uri] starts_with "/test"} { pool pool4 } }
I have corrected the typos.. in any case thats not going to work as the first condition will always match.
FYI when pasting iRules, put your code on the page, when done, highlight the code and press TAB to indent it. Check the preview and you should see it formatted correctly.