Forum Discussion
IRule to do if, and, or..
Can someone please take a look at this irule and tell me what we are missing. The goal is to have a rule that looks for a host, and multiple different paths in the URI. If the URI does not contain one of the 2 listed URIs we want to redirect else, we want the request to continue with the URI intact.
when HTTP_REQUEST { if {([HTTP::host] contains “x.x.x.x.com")}{ if {!([HTTP::uri] contains “/blah/foo/“) or (![HTTP::uri] contains “/blah/foo.html")}{ HTTP::redirect "https://someplace.com/Login.jsp" } else { pool some_pool } } }
1 Reply
- Kevin_Stewart
Employee
Cleaned it up a bit:
when HTTP_REQUEST { if { ( [HTTP::host] contains "x.x.x.x.com" ) } { if { ( [HTTP::uri] contains "/blah/foo/" ) or ( [HTTP::uri] contains "/blah/foo.html" ) } { pool some_pool } else { HTTP::redirect "https://someplace.com/Login.jsp" } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com