Admin
15th June 2009, 10:05 PM
Excellent article on How to conserve your bandwidth stealing.
Steps to Take
Protecting your images using a .htaccess file is trivial.
1.
Put all the images you wish to protect from being stolen (bandwidth-wise) in a separate directory.
2.
Create an ASCII text file named .htaccess and save it in that directory. Note that the name starts with a fullstop (or period) and is entirely in small letters (ie, lowercase). Cut and paste (unless you're using IE 6 in which case you just have to type it yourself) the following lines into that file:
SetEnvIfNoCase Referer "^http://www.your-domain-name-here.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://www.your-domain-name-here.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://your-domain-name-here.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://your-domain-name-here.com$" locally_linked=1
SetEnvIfNoCase Referer "^$" locally_linked=1
<FilesMatch "\.(gif|png|jpe?g)$">
Order Allow,Deny
Allow from env=locally_linked
</FilesMatch>
Change "your-domain-name-here.com" to your real domain name. If your site can be accessed using other domain names (eg "www.your-domain-name-here.net"), be sure to add an additional SetEnvIfNoCase line for each of those domain names (with the URLs appropriately changed to the URLs of your domains. On the other hand, if your site can only be accessed using one domain, for example, using only "www.your-domain-name-here.com", then delete the line with "http://your-domain-name-here.com". The cut and paste code above caters to the usual case where most sites can be accessed with or without the "www" prefix.
Do not correct my spelling in the code snippet given above. "Referer" (with only one "r" in the middle of the word) is the word that needs to go into the .htaccess file - do not change it to "Referrer".
That's all there is to it. The above file should protect all images that have ".gif", ".png", ".jpg" and ".jpeg" extensions.
Remember to use an ASCII text editor (also known as "text editor" or "plain text editor") to create the .htaccess file. Do not use Microsoft Word or Wordpad. Notepad (found on all Windows systems) is fine.
Source (http://www.thesitewizard.com/archive/bandwidththeft.shtml)
Steps to Take
Protecting your images using a .htaccess file is trivial.
1.
Put all the images you wish to protect from being stolen (bandwidth-wise) in a separate directory.
2.
Create an ASCII text file named .htaccess and save it in that directory. Note that the name starts with a fullstop (or period) and is entirely in small letters (ie, lowercase). Cut and paste (unless you're using IE 6 in which case you just have to type it yourself) the following lines into that file:
SetEnvIfNoCase Referer "^http://www.your-domain-name-here.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://www.your-domain-name-here.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://your-domain-name-here.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://your-domain-name-here.com$" locally_linked=1
SetEnvIfNoCase Referer "^$" locally_linked=1
<FilesMatch "\.(gif|png|jpe?g)$">
Order Allow,Deny
Allow from env=locally_linked
</FilesMatch>
Change "your-domain-name-here.com" to your real domain name. If your site can be accessed using other domain names (eg "www.your-domain-name-here.net"), be sure to add an additional SetEnvIfNoCase line for each of those domain names (with the URLs appropriately changed to the URLs of your domains. On the other hand, if your site can only be accessed using one domain, for example, using only "www.your-domain-name-here.com", then delete the line with "http://your-domain-name-here.com". The cut and paste code above caters to the usual case where most sites can be accessed with or without the "www" prefix.
Do not correct my spelling in the code snippet given above. "Referer" (with only one "r" in the middle of the word) is the word that needs to go into the .htaccess file - do not change it to "Referrer".
That's all there is to it. The above file should protect all images that have ".gif", ".png", ".jpg" and ".jpeg" extensions.
Remember to use an ASCII text editor (also known as "text editor" or "plain text editor") to create the .htaccess file. Do not use Microsoft Word or Wordpad. Notepad (found on all Windows systems) is fine.
Source (http://www.thesitewizard.com/archive/bandwidththeft.shtml)