Image Thieves | June 3, 2004
I noticed several weeks ago that photo-inside.com were deep linking to my images. This meant that not only were they using my images without permission, but they were piggy backing on my bandwidth as well. My host is currently charging me a small fortune for extra bandwidth so you can imagine that I was a little bit pissed off.
I wrote a short, sharp email asking them to stop, but unsurprisingly heard nothing back. I thought about using .htaccess to redirect them to some alternative content. In the past I've done this when people deep linked to the games on the message site. In that case, you got served with a swiff explaining that people were stealing the games, a link to the games section on our site and a request that people dobbed in the thieves.
Another option was to post up some rude or offensive image. As the site owners probably already had the images in their cache, they would see the old image, while new visitors would get to see something nasty. I entertained this notion for about 5 minutes, but decided it was a little juvenile.
In the end I've just added a .htaccess file to my image directory that denies access to any images called from outside the site. It won't stop people from lifting the images, but at least it stops them stealing my bandwidth. I believe that this method may cause problems for a few legit visitors who are accessing the site content through a server cache, so sorry if I've caused you any inconvenience.
If you are at all interested in the contents of my .htaccess file, here it is. Don't ask me to explain it because I'm no server guru and pretty much lifted it off another site.
SetEnvIfNoCase Referer "^http://www.andybudd.com/" locally_linked=1 SetEnvIfNoCase Referer "^http://www.andybudd.com$" locally_linked=1 SetEnvIfNoCase Referer "^http://andybudd.com/" locally_linked=1 SetEnvIfNoCase Referer "^http://andybudd.com$" locally_linked=1 SetEnvIfNoCase Referer "^$" locally_linked=1 <FilesMatch "\.(gif|png|jpe?g)$"> Order Allow,Deny Allow from env=locally_linked </FilesMatch>
Posted at June 3, 2004 7:31 PM
Robin said on June 3, 2004 8:47 PM
I ran into something similar a while back on my site and went the .htaccess route as well, though I structured it a bit differently. I wanted to be able to link directly to my images on forums I frequent and still disallow unauthorized access - so I made a “whitelist” of sorts.
Here’s my file contents:
^http://(www.)?organicallydigital.com.*$ [NC]
RewriteEngine on
RewriteCond
RewriteCond {HTTP_REFERER} !^http://(www.)?forumsite.com.*$ [NC]
RewriteRule .*[Jj][Pp]?[Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$ leech.gif [R,L]
Which will redirect unauthorized linkers to this image:
Tempting as it was to redirect them to something distasteful, I decided I spend that 1K of bandwidth advertising for my site instead.