Forum Discussion

João_Assad_4295's avatar
João_Assad_4295
Icon for Nimbostratus rankNimbostratus
Nov 18, 2005

hotlink prevention

I' made iRule to prevent image hotlinks to our site


when HTTP_REQUEST {
   set referer [HTTP::header Referer]
   set refer_host [URI::host $referer]
   set uri [HTTP::uri]
   
   if { not [matchclass $refer_host contains $::allowed_referers] and $refer_host ne "" } {
      log local0. "hotlink detected: $referer"
      STATS::incr site_stats hotlinks_detected
      HTTP::respond 301 "Location" "http://www.oursite.com/images/no_hotlink.gif"
   }
}

Its working fine but I'd like to make the replacement image be also a link and can't figure out how. Is it possible ? Any ideas ?

Regards,

João Assad
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Can you explain what you mean by "make the replacement image be also a link"? I don't know what "the replacement image" is, so I can't really recommend how to make it a "link".