For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

bbensten_8485's avatar
bbensten_8485
Icon for Nimbostratus rankNimbostratus
May 01, 2014

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

  • 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"  
            } 
        } 
    }