The Apache Server's Mod Rewrite Engine (which must be compiled into your server to allow you to do this) can examine the name of the document requesting a file of a particular type. You can then define logic that basically does the following:
If the URL of the page requesting the image file is from an allowed domain, display the image- otherwise return a broken image.
The logic, or rules are then placed in the directory(s) that contain your image files.
IS THIS A PERFECT SOLUTION?
No. In order for it to work, the browser that requested the page must return the URL of the page, or what is called the HTTP_REFERER. There is also a performance penalty on the server due to the extra overhead testing the file requests.
This method should be used when offsite linking has become an issue of concern to you. Some tolerance or maybe a gentle e-mail to the other site's webmaster may also be an acceptable solution. I have actually made a few friends this way!
HOW EXACTLY CAN I DO THIS?
STEP 1: Ensure mod_rewrite is enabled on your server. (Yes, it is.)
STEP 2: Get organized! Try to get all of your images into directories that do not contain your HTML files. Each directory containing the images should have an empty index.html file to prevent people from looking at your directory listing.
STEP 3: Create or edit a .htaccess in one of the directories containing your images. I suggest doing one directory first so you can test your rules, and quickly comment out the lines or rename the file if it causes server configuration errors. The .htaccess file should contain the following lines:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteRule .*.gif$ - [L]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteRule .*.jpg$ - [L]
NOTE: When cutting and pasting, be sure that each RewriteCond is on one line. Line wrapping in the page display could introduce broken lines.
Change domain.com to whatever your domain name is. Be sure to use both the plain domain name as well as the www so that people coming to your site either way are not deprived of your images!
STEP 4: Test! Create a page on another server and insert in image tag pointing to an image in the protected directory. If you get a broken image icon- you did it! The requests will still appear in your logs, but your bandwidth will be protected.
On files such as .MIDI (music files), it will result in a Forbidden error.
Sales
Support Department
Billing Department(For customers with live account only)
We are in Web Hosting business since 1997 and we know your needs, we do our best for customer satisfaction. Giganetwebhosting.com offers a 'No Questions Asked' Anytime money back guarantee with all unlimited web hosting plans. If you decide to cancel your account at anytime Giganet web hosting will refund you for the remainder of your term, excluding domain registration fees, for which we incur a cost. It's like a warranty that never expires! Your satisfaction is our top priority, and we're confident that you'll be pleased with our services. Best web hosting risk free !
Our servers have special security applications that ensure a secure and reliable hosting environment. Our 24/7 network monitoring ensures that, if an issue does arise, we address it immediately. We provide many additional services and modifications to the default Operating System and control panel installation which greatly enhances the security, reliability, and compatibility of our servers and softwareand offer best web hosting solutions available to our clients. Secure and safe unlimited web hosting, Vps hosting and dedicated servers hosting.

We offer you a price guarantee for any future account renewals. We guarantee that your renewal price will be the same or less for all unlimited web hosting plans. Don't fall for the high discount bargains which are offered by most hosting providers. Read the fine print and note that the initial discounted price is usually 50-90% lower than the standard price at which you will be FORCED to renew! Cheap web hosting and best web hosting combined !
The only place for affordable hosting with top hosting services.