The Referer header will start with a protocol like http:// or https://. You could try something like this to be more specific:
when HTTP_REQUEST {
switch -glob [string tolower [URI::host [HTTP::header "Referer"]]] {
"www.mywebsite.com"
"www.contentwebsite.com" {
Allow Request to go through...
}
"" {
HTTP::respond 200 content ""
log local0 "Blank Referer from IP: [IP::client_addr]"
}
default {
HTTP::redirect [HTTP::header "Referer"]
log local0 "Blocked Referer: [HTTP::header value Referer] from IP: [IP::client_addr]"
}
}
}
Aaron