Forum Discussion
Anthony_5469
Nimbostratus
May 16, 2013How to Block Specific Host from Hotlinking Images?
Hi,
I'm not a iRule guru so I'm not sure where to start, but I hope someone has a script or knows how to create an iRule which will block specific hosts from hotlinking images on my website whic...
Kevin_Stewart
Employee
May 20, 2013I think the best you can do is to filter on the source address and maybe the file requested (or file types/extensions).
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals banned_host_list] and [class match [string tolower [HTTP::path]] ends_with banned_image_content] } {
HTTP::respond 200 content "buzz off image hotlinker"
}
}
Where "banned_host_list" and "banned_image_content" are data groups listing IP addresses or IP ranges (address-based), and image file extensions (ex. .jpg, .jpeg, .gif, .png, etc.) - (string-based), respectively. There are still ways around this of course, like adding an innocuous hash tag to the URI to obscure the file extension, but the above should catch most of the offenders.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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