Forum Discussion

HenryW_137530's avatar
HenryW_137530
Icon for Nimbostratus rankNimbostratus
Mar 29, 2017

Irule to block wildcarded urls

I am trying to configure in irule iRule to block these two wildcarded urls: accu-weather.com/widget or map.baidu.com/sdk.php

 

will this irule work class blockthis { "accu-weather.com/widget" "map.baidu.com/sdk.php" }

 

when HTTP_REQUEST { if {[class match [string tolower [HTTP::uri]] equals blockthis } { drop }

 

1 Reply

  • Try:

    when HTTP_REQUEST { 
    set VARIABLE [HTTP::host][string tolower [HTTP::uri]]
    if { [class match $VARIABLE equals blockthis] } { 
    drop 
    }
    }