I love laying the smack down on people that try to get away with dirty little evil things online. Today’s example: someone selling our software on eBay, and hotlinking our front page flash demo and images from our site. Basically, they’re using our servers and bandwidth to illegally sell copies of our software.
So I dug down a bit in Apache and implemented a few rules to fix things up. I used to just issue a 403 Forbidden HTTP error when they did this, but I just disabled that rule in favor of today’s new one.
What we do is rewrite requests for any images or flash files coming from eBay to a special image/flash file that helps educate you on the evils of software piracy. Arrrr
To test things out, I also implemented it on this site before doing it live. Here’s an example of a normal image, and then a hotlinked image:


The code for those images is:
<img src="/images/HDProBox.jpg" alt="Home Designer Pro Box" /> <img src="http://www.chiefarchitect.com/HDProBox.jpg" alt="Home Designer Pro Box" />
How do you do it? With Apache, it’s pretty simple. In your conf/httpd.conf, add:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/warning.jpg$
RewriteCond %{HTTP_REFERER} ^http://(www\\.)?bogomip.net/.*
RewriteRule .*\\.(jpg|gif|png)$ http://chiefarchitect.com/warning.jpg
Swap out bogomip.net and chiefarchitect.com as needed. You must have mod_rewrite active for this to work.
2 Responses to “Smackdown”
|
|
Quoth BenY
January 22nd, 2007 at 12:11 am Very clever idea! |
|
|
Quoth Webmonster
January 23rd, 2007 at 11:16 am Thanks, I try. The best part about this kind of solution is the offender has already loaded the files they’re hotlinking, so they don’t see the substitution until their browser cache has expired, but any new visitors see it instantly, it’s brilliant, really. |