I think the following a more simpler iRule:
when HTTP_REQUEST {
if { [HTTP::header "Referer"] contains "gadget" } {
discard
}
}
This simply means that if you have a referer that contains gadget anywhere in the header field it will discard. For example it was discard "gadget, disgadget, mothergadget, papagadget, gogogadgetchopper, etc" However, I am not sure if it's case sensitive. If it is then it the code could be written as the following:
when HTTP_REQUEST {
if { [string tolower [HTTP::header "Referer"]] contains "gadget" } {
discard
}
}
Click here if you want to look at HTTP::header function more closely.
Hope this helps
CB