Trust me, you don’t want to. Bad things will happen if you do.
For the benefit of anyone who’d like to implement the same anti-theft device, here’s my advice. First, make sure all your image files, video files, etc. – all items worth stealing bandwidth over, basically – are in a separate folder from your main HTML or PHP files. It’s not strictly necessary to do this, but’s a lot easier and you’ll have to tweak the code a bit of you don’t. Then make a new folder, just under your top level, web-accessible directory (the one we all see if we go to www.yourdomain.com), which I’ll call Nasty. Upload the files you want bandwidth thiefs to see into your Nasty file. I recommend this one, this one and this one for starters. Then create a simple text file in your images directory (the one where all your pictures, videos, etc. are) called .htaccess (don’t forget initial period). If you create it under Windows, you’ll have to call it something else, then upload it as ASCII, then rename it after it’s up. In that file, include this:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?yourdomain.com/.*$ [NC]
RewriteRule .*$ /Nasty/whosyourfroggy.gif [R,L]
Substitute the name of your actual domain for “yourdomain.com,” the name of your nasty directory for “Nasty” and the name of the file you’ve chosen to ding people with for “whosyourfroggy.com,” and voilà.
All this assumes, of course, that your web host supports .htaccess and mod_rewrite. Not all do.
UPDATE: Depending on your host, you may want to add another RewriteCond line to include the domain associated with your control panel. If you use ICDSoft, for example, you can access your control panel at www.yourdomain.com/cp but will be redirected to cp.serverXXX.com, where XXX represents a three-digit number of the specific server your account was assigned to. In that case, you’d want to add this condition before the RewriteRule:
RewriteCond %{HTTP_REFERER} !^http://(cp.)?serverXXX.com/.*$ [NC]
As far as I know, there is no limit on how many conditions you can add, so if you want to actually allow certain domains (yours, or those of friends) to “steal” bandwidth, you can add those domains as well.
UPDATE: Speaking of stealing, I’d be remiss if I didn’t tell you where I got this from.