Shay_Ben-David1
Mar 13, 2007Nimbostratus
Referer check
Hi, i used this irule from the wiki list:
when HTTP_REQUEST {
set refer_host [string tolower [URI::host [HTTP::header Referer]]]
if { ( [matchclass [HTTP::uri] ends_with $::images] ) and
( not [matchclass $refer_host starts_with $::allowed_referers] ) } {
log "hotlink detected from host: $refer_host"
HTTP::redirect "https://mysite.com"
HTTP::respond 301 "Location" "http://[HTTP::host]/Online/images/logo-account.gif"
}
}
it seems to work fine, but i need help on this irule to check the referer only on the main page, like aspx or jsp files, does anyone have an idea how to perform this with irule ?