Forum Discussion
Shay_Ben-David1
Nimbostratus
Mar 13, 2007Referer 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 ?
- You could put .aspx and .jsp into the images data group. That way the first matchclass would only pass if they are at the end of the uri.
- Shay_Ben-David1
Nimbostratus
i did put the .aspx and .jsp into the images data group, but still the redirect is not perform based on the missing referer in the jsp/aspx files ?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects