F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

Thiyagu's avatar
Thiyagu
Icon for Cirrus rankCirrus
Nov 21, 2022

irule to drop the traffic based on the specific URI and allow other traffic to pass for further proc

Hello All,

I need help with an Irule to drop the traffic based on the specific URI and allow other traffic to pass for further processing.

Could you please help whether the below irule will work as expected?

if { ( [string tolower [HTTP::uri]] contains "/test/") } {
HTTP::respond 200 content "not allowed..."
reject
} else {
pass
}
}

2 Replies

  • sorry here is the iRule which I have developed:

     

    when HTTP_REQUEST {

    if { ( [string tolower [HTTP::uri]] contains "/..;/") } {
    HTTP::respond 200 content "not allowed..."
    reject
    } else {
    return
    }
    }

    • Hi Thiyagu , 
      you do not need to "else" statement , So try this : 

      when HTTP_REQUEST {
      if { ( [string tolower [HTTP::uri]] contains "/..;/") } {
          HTTP::respond 200 content "not allowed..."
          drop
      }
      }

      And  output from my Lab : 

      > any request doesn’t contain "/..;/"  will Pass without issues. 
      so no need for "else" statement

      Regards