How can I use .htaccess to protect my bandwidth?
To prevent people from hotlinking files on your website, use the .htaccess file with the apache rewrite module. The module configuration is complex, but very powerful once you understand how it works. Here is an example .htaccess with mod_rewrite:
RewriteEngine on RewriteCond % !^.*mywebsite.com.*$ [NC]
RewriteRule ^.*$ http://www.mywebsite.com/sorry.html [R]
You make this .htaccess file in the directory you wish to protect. It is effective for all subdirectories. You can change the rewrite URL (http://www.mywebsite.com/sorry.html) to what you want the user redirected to. You don't have to make a webpage, set it to whatever you would like.
Note: There must be a backslash '' before the '.' on the second line.
Example:
It should be: mywebsite.com.
Not: mywebsite.com