Firewall Forums

Go Back   Firewall Forums > Daily Pains > HOW-TOs for Anything
User Name
Password
Portal Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

HOW-TOs for Anything If you have a HOW-TO for Aything please post them here.

  #1  
Old 04-22-2006
FirewallForums FirewallForums is offline
Administrator
 
Join Date: Mar 2006
Posts: 7
FirewallForums has disabled reputation
Default HOW-TO prevent Image Linking

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.
__________________
--------------------------
Firewall Forums - F.F. Team
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:18 PM.



All Trademarks are copyrighted to their respective owners.
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 2006 (c) Firewall Forums