BigNoseBird.Com- home Small Logo
The 508 compliant Guide to 
       Big Nose Bird
BACK
WARNING: Be very careful editing your server configuration or .htaccess files. Even a minor typographical error can make your site unusable! Always make a backup copy of any file so you can recover quickly.

Stopping People from Using Your Images on their Web Pages. (Bandwidth Theft)

If you have some nice graphics on your site, you might notice that other webmasters, usually newbies are having their readers pull the graphics directly from your site. If your bandwith is metered, then you are paying to support somebody else's site! Depending on how busy that other site is, it can also place additional load on your server.

There is a fairly simple solution to this using Mod Rewrite. It is not by any means perfect, but it should at least help. It depends on the browser sending the referring page along with the image request. Since most browsers do this, you will see results very quickly.

The idea to this is to save bandwidth and not be obnoxious about it. One could return a nasty image file for off-site requests, but that is not nice, and you are wasting your bandwidth! This set of rules simply reports the image files as being "gone", creating a broken image icon on the browser.

NOTE: In order to use this feature of the Apache Server, you must make sure that the server was installed with the mod_rewrite.o file. This is done by adding the line to the Configuration file before compiling the server.
AddModule modules/standard/mod_rewrite.o

THIS SOUNDS PERFECT! HOW DO I DO IT?

Create a .htaccess file in the image directory you wish to protect. This set of rules basically looks at the domain name provided by the HTTP_REFERRER (from the beginning) without regard to upper or lower case. (NC means No Case). The RewriteRule for gif and jpg is to report the file as gone. Do not use F for forbidden if you are using ErrorDocument redirects.

You can also do this to protect other types of files such as MIDI files by changing the gif to mid. Of course, be sure to change bignosebird.com to whatever your domain happens to be!

Note: This does not prevent people from right-clicking and saving images on your pages.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://bignosebird.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.bignosebird.com/.*$ [NC]
RewriteRule .*\.gif$        -                                [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://bignosebird.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.bignosebird.com/.*$ [NC]
RewriteRule .*\.jpg$        -                                [L]



Find or Give Help on the BBS
 
Home Top E-Mail
If it looks great, it's by Christine
Some Fine Print
© 1997-2003 BigNoseBird.Com®, Inc. All rights reserved. All other trademarks are the sole property of their respective owners. The products that we recommend are only ones that we use. We have no relationship with any of the authors or their companies. We cannot assume responsibility for their ultimate performance or lack of same. We also cannot assume responsibility for either any programs provided here, or for any advice that is given since we have no control over what happens after our code or words leave this site. Always use prudent judgment in implementing any program- and always make a backup first! For further information, please read our Privacy Statement. We can be contacted at webmaster@bignosebird.com.


<reallybig.com>
Web Builder Network Portal
Advertise
on the
Reallybig.com
Network
BigNoseBird Newsletter
Subscribe
Un-Subscribe


Sign up today to receive our low volume newsletter. Tips, tricks, news, and whatever else crosses our minds.
Back Issues
Privacy Statement