Blocking Image Hotlinking, Leeching and Evil Sploggers with Url Rewrite
hanselman.com
hanselman.com
<Directory /images>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !mydomain.com
RewriteRule .*\.(gif|jpg|png)$ http://images.mydomain.com/no.gif [NC]
</Directory>Maybe he already thought of it, but it might also help to send DMCA notices to Google as well as the website's registrar and host. I'd love to see a bad guy get taken down by the good guys for once.
Worst I've seen done is when sites will throw the stupid "No Hotlinking" message image when they don't see a matching referrer from the same domain. In other words, a "fuck you" to anyone who decides to configure their browser to not send referrers.
In fact it even makes any hotlinking filters set up like this not work at all, and serve you the picture normally.
Clients SHOULD NOT include a Referer header field
in a (non-secure) HTTP request if the referring page
was transferred with a secure protocol.If your site and all of the linked/embedded assets are HTTPS, it will work as intended.
I configure my browser to send the referrer as the site I'm currently on as I don't believe a site has the right to know where I've come from. Does this also break the internet?
This isn't an issue for me any more, but I had some ideas over the years -
1) Make hotlink images serve pictures with a massive watermark. This way you get free branding/advertising.
2) Serve specific images to specific problem hot linkers, for example "Pinterest sucks (insert favorite word)."
2) If you are more malicious, make the behavior random so it isn't immediately evident to the site owner/moderator what is going on.
Image attribution gets little respect, just take a look at what happened to Google Images. The service went from being obvious (to the mass market user) where the image was coming from (assuming it was being published by the original owner) to now it just looks like Google has their own stock photography service.
Irregardless of your opinion on copyright, everyone agrees on attribution when it comes to code. As far as I believe the same is true for images. Hotlinking is the tip of a very problematic iceberg.
- Downloading
- Search engines
- Caching
- Sharing (usually nabs thumbnail)
It's just not a good idea. And it doesn't really work. Any scraper worth their salt would just fake the referrer and be fine.