How you block 'offsite linking'
If webmasters on other websites use your graphic files by making a direct link from their pages to your files (thus including your pictures in their page, and thus consuming traffic from you) it is called “offsite linking”. This can unfortunately become very costly for the victimised website.
The problem is that traffic quantities over a certain limit must be billed by the gigabyte, and can therefore be a very substantial extra billing if we are talking about large files or a very wide-ranging abuse.
To prevent this from happening you can make a .htaccess file in the root of the folder you wish to protect, the file must contain the following lines:
---cut---
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://your-domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www. your-domain.com /.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http:// your-parked-domain.com /.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www. your- parked-domain.com /.*$ [NC]
RewriteRule .*\.gif$ - [F,L]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://your-domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www. your-domain.com /.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http:// your-parked-domain.com /.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www. your- parked-domain.com /.*$ [NC]
RewriteRule .*\.jpg$ - [F,L]
---cut---
This will prevent GIF and JPG files to be read from any other domain than your-domain.com and your-parked-domain.com from the moment you save the file in the folder. If there is a need to allow certain sites access to the files simply add them to the list of domains.
