FirewallForums
04-22-2006, 03:22 AM
Image linking from remote sites is not only is stealing but also bandwidth leeching. Leechers, Bandwidth thieves whatever you call them are people who use images hosted on your web server on their own pages. This is not
For most web hosts these days most hosting operations offer plenty of bandwidth and for people who don’t pay by the gigabyte for the amount of data they transfer it is not that big a deal. Who cares if some little site uses your icon of 234 bytes? For larger sites, however, it's a much bigger problem. If a 234 byte gif is hotlinked on a site that gets, say, 10,000 hits a day, that’s 2.23 GB of data transferred from your site without a single person actually visiting your site. If you have only a few gigabytes of transfer available per month as som e hosts offer or worse you pay money per gigabyte, this will start coming out of your pocket change. Now that could be a worse case or what if it is not? Lets say you run a gallery of your personal photos and they get to be peoples fav wallpaper? Now that could end up being mega bandwidth.
So what can you do about this?
We can use .htaccess to deal with these hot linkers. .htaccess is very powerful and it is used for many powerfull methods to deal with your site.
First you need to create a .htaccess file in the root of your website. This is normally html on most hosting sites. It is just a plain text or ASCII file. Use a good editor like the FREE CrimsonEditor at http://www.crimsoneditor.com to create it. Then you wil need an FTP application like FilleZilla (Another Free software) or similar to place it into your html or docs root for it to work.
Cut and past the following into a .htaccess file.
--------------- Cut --------------------
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.mysite.com/.*$ [NC]
RewriteRule .*\.(gif¦jpg)$ - [N,F,L]
--------------- Cut --------------------
On this line "RewriteRule .*\.(gif¦jpg)$ - [N,F,L]" you can also add png etc. To change this you just separate it using the pipe charactor " ¦ ". So "RewriteRule .*\.(gif¦jpg)$ - [N,F,L]" becomes "RewriteRule .*\.(gif¦jpg¦png)$ - [N,F,L]" and so on if you wish to add other image types.
This HowTo may change over time. But for now this works for me. :-) If you have suggestions feel free to coment and/or rate this HowTo.
For most web hosts these days most hosting operations offer plenty of bandwidth and for people who don’t pay by the gigabyte for the amount of data they transfer it is not that big a deal. Who cares if some little site uses your icon of 234 bytes? For larger sites, however, it's a much bigger problem. If a 234 byte gif is hotlinked on a site that gets, say, 10,000 hits a day, that’s 2.23 GB of data transferred from your site without a single person actually visiting your site. If you have only a few gigabytes of transfer available per month as som e hosts offer or worse you pay money per gigabyte, this will start coming out of your pocket change. Now that could be a worse case or what if it is not? Lets say you run a gallery of your personal photos and they get to be peoples fav wallpaper? Now that could end up being mega bandwidth.
So what can you do about this?
We can use .htaccess to deal with these hot linkers. .htaccess is very powerful and it is used for many powerfull methods to deal with your site.
First you need to create a .htaccess file in the root of your website. This is normally html on most hosting sites. It is just a plain text or ASCII file. Use a good editor like the FREE CrimsonEditor at http://www.crimsoneditor.com to create it. Then you wil need an FTP application like FilleZilla (Another Free software) or similar to place it into your html or docs root for it to work.
Cut and past the following into a .htaccess file.
--------------- Cut --------------------
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.mysite.com/.*$ [NC]
RewriteRule .*\.(gif¦jpg)$ - [N,F,L]
--------------- Cut --------------------
On this line "RewriteRule .*\.(gif¦jpg)$ - [N,F,L]" you can also add png etc. To change this you just separate it using the pipe charactor " ¦ ". So "RewriteRule .*\.(gif¦jpg)$ - [N,F,L]" becomes "RewriteRule .*\.(gif¦jpg¦png)$ - [N,F,L]" and so on if you wish to add other image types.
This HowTo may change over time. But for now this works for me. :-) If you have suggestions feel free to coment and/or rate this HowTo.