Home : General : Chit Chat :

General: Chit Chat: Re: [Teambldr] Image Theft: Edit Log

Here is the list of edits for this post
Re: [Teambldr] Image Theft
Hi.. If you have mod_rewrite enabled on your server.. here is a better solution..

I developed this to secure my javascript source files (*.js). I believe this method is foolproof.. well.. no.. but it's the best method in my opinion.

RewriteEngine On
RewriteBase /images
RewriteCond %{HTTP_REFERER} !^http://[^/]*yourdomain.com
RewriteCond %{REQUEST_URI} \.(jpg|gif|png|bmp)$
RewriteRule ^.*$ /yousuck.gif

that goes into your .htaccess.. basically.. if anyone tries to go straight to the image or if they try and put the image on their site.. it'll display "yousuck.gif" instead.. xoom.com used to do this.. geocities.com does something similar. umm.. they can always just save your image and upload it to their own site.. so it doesn't keep them from "stealing" your images.. but it keeps them from "stealing" your bandwidth..

if you want to prevent stealing images.. you could just do a no right click javascript on the site.. that's just 2 lines of code.. if you use both of these methods.. your images can't be taken, unless they disabled javascript.. but there is no way of preventing that.. the browser's cache stores the images anyways..


ya.. so try it.. it works great. :P


[edit]oh.. it needs a little changing for images.. the code i used was for .js files only.. umm.. for images you'd probably want the referer line to be "if referer && referer =~ /yourdomain/" rather than what it is now..

Last edited by:

widgetz: Jul 29, 2002, 2:39 PM

Edit Log: