+ Reply to Thread
Results 1 to 5 of 5

Thread: Blocking Bandwidth Leeches ~ V2.1

  1. #1
    lair360 is offline x10 Sophmore lair360 is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    200

    Post Blocking Bandwidth Leeches ~ V2.1

    Version: 18.1
    Revision: 42 Build 154

    Introduction: This source was made for user to block bandwidth theif.

    1.] Download Notepad++ from this website and install it…
    ———————
    http://filehippo.com/download_notepad/

    2.] Copy this source code and save your file as…

    File type: .htaccess
    Notes: save this file as: “All types”

    Warning: you must clear your system cache to see the changes…

    Details: add some of your offending website, blogs or search engines…ect.

    Example…
    ——————–
    Code:
     
    RewriteCond %{HTTP_REFERER} ^http://(www\.)?mysite\.com [NC]
     
    RewriteCond %{HTTP_REFERER} ^http://(www\.)?google\.com [NC]
    Tips: you can cancel out the dashes and use this style instead…
    ———————————–
    Code:
     
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?myspace.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal.com/ [NC]
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]
    ———————————–

    Single website linking - blocked
    —Copy Source Code—
    Code:
     
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal\.com/ [NC]
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]
    —End Source Code—

    If you want to block multiple websites, you can use this source code which is provided below.

    Notes: the last line on “RewriteCond %{HTTP_REFERER}”, it must have an [NC] codes or it will not work!

    Multiple website linking - blocked
    —Copy Source Code—
    Code:
     
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?myspace\.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal\.com/ [NC]
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]
    —End Source Code—

    Notes: you can also add different extension to enhance your file protection. To do this just take a look and compare this code below from the above…

    —Copy Source Code—
    Code:
     
    RewriteRule .*\.( jpeg|jpg|gif|png|mp3|zip|rar)$ - [F]
    —End Source Code—
    Copyright 2001-2008 Lair360

    Blocking all hotlinker!

    If you want to block hotlinking completely, so that no one can hotlink your files, you can use this source instead of the above.

    Advice: replace some of my trusted website with your own website. After that, just upload the file to your ftp server.

    Warning: if you’re going to redirect someone to a different image, that image must not be on your FTP server or you will create an infinite loop!

    —Copy Source Code—
    Code:
     
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?lair360.srhost.info [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?lair360.wordpress.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?stonerocket.net [NC]
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]
    —End Source Code—

    This source is a little lighter and less aggressive. It’s also easy to maintain…

    —Copy Source Code—
    Code:
     
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?lair360.srhost.info/ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?lair360.srhost.info/blog/ [NC]
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]
    —End Source Code—

    This is the final source to allow only trusted website to hotlink your images.
    You must also allow your website on the first line to allow your webpage to upload this images…

    —Copy Source Code—
    Code:
     
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?lair360.srhost.info [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?lai360.srhost.info/blog/ [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?stonerocket.net [NC]
    RewriteRule \.(jpg|jpeg|png|gif|zip)$ - [NC,F,L]
    —End Source Code—

    End of Part One...

  2. #2
    lair360 is offline x10 Sophmore lair360 is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    200

    Re: Blocking Bandwidth Leeches ~ V2.1

    Start of Part Two...

    Notes: you can also change one of the “RewriteRule” to forbid users from stealing your images and bandwidth.

    —Copy Source Code—
    Code:
    RewriteRule \.(jpeg|jpg|gif|png|mp3|zip|rar)$ /images/nohotlink.jpe [L]
    
    RewriteRule \.(jpeg|jpg|gif|png|mp3|zip|rar)$ - [F]

    —End Source Code—

    To block Search engines, you can use this instead…

    Notes: it will not block all of the search engines. This example will only block yahoo, google and askjeeves.

    —Copy Source Code—
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?google.com [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?yahoo.com [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?askjeeves.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif|zip)$ - [NC,F,L]

    —End Source Code—
    Copyright 2001-2008 Lair360

    This is another alternative, you can also use this source code…if you desire…

    Allowing multiple sites and block all other sites.
    —Copy Source Code—
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?you\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?ok1\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?ok2\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpg|jpeg|gif|bmp|png|swf)$ - [F]

    —End Source Code—

    Allowing one site and block all other sites.
    —Copy Source Code—
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?you\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpg|jpeg|gif|bmp|png|swf)$ - [F]

    —End Source Code—

    Here is the bonus and it also works!
    —Copy Source Code—
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(.*\.)?lair360.srhost.info [NC]
    RewriteCond %{HTTP_REFERER} !^http://(.*\.)?lair360.wordpress.com [NC]
    RewriteCond %{HTTP_REFERER} !^http://(.*\.)?stonerocket.net [NC]
    RewriteRule .*\.(jpg|jpeg|png|gif|zip|rar)$ - [F]

    —End Source Code—

    As I’ve said this before, you can use this code below instead of using the [F] command.

    —Copy Source Code—
    Code:
    RewriteRule .*\.(jpeg|jpg|gif|png|mp3|zip|rar)$ /images/nohotlink.jpe [L]
    
    RewriteRule .*\.(jpeg|jpg|gif|png|mp3|zip|rar)$ - [F]

    —End Source Code—

    This source code will only block some outside url and not all of them. But, this source is only use for advance users!

    —Copy Source Code—
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^http://([a-z0-9]+\.)?domain1.com(/)?.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://([a-z0-9]+\.)?domain2.com(/)?.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http://([a-z0-9]+\.)?domain3.com(/)?.*$ [NC]
    RewriteRule .*\.(gif|jpg|png)$ - [F]

    —End Source Code—

    This is also an alternative with an option to allow “Symlink”.
    But, if you want to use this option, you’ll need to remove one of the special character from the second line.

    —Copy Source Code—
    Code:
    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain1.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourotherdomain2.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourotherdomain3.com/.*$ [NC]
    RewriteRule \.(gif|jpg|jpeg|jpg|png|js|css)$ - [F]

    —End Source Code—
    Copyrighted by Lair360

  3. #3
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Blocking Bandwidth Leeches ~ V2.1

    nice tut, this'll help those who want more control than what cpanel offers

    i've never heard of using a jpg image with the extension of jpe, but google says its valid
    Last edited by xPlozion; 01-09-2009 at 09:46 AM.

  4. #4
    lair360 is offline x10 Sophmore lair360 is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    200

    Re: Blocking Bandwidth Leeches ~ V2.1

    Quote Originally Posted by xPlozion View Post
    nice tut, this'll help those who want more control than what cpanel offers

    i've never heard of using a jpg image with the extension of jpe, but google says its valid
    Thank you very much for your complement!
    Well...I make articles to assist other users. I also put a lot of efforts into these articles, so that users could choose, read and enjoy the qualities of my work...

  5. #5
    808solutions is offline x10Hosting Member 808solutions is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    7

    Re: Blocking Bandwidth Leeches ~ V2.1

    wow thank you for the code, its to bad alot of people dont take the time to set up htaccess, leaving sites vulnarable to attack, dos, or like you said file leeching :|

+ Reply to Thread

Similar Threads

  1. BandWidth Explained
    By teclanka in forum Tutorials
    Replies: 9
    Last Post: 10-13-2008, 07:47 AM
  2. Bandwidth not logged since the 12th...
    By Smith6612 in forum Free Hosting
    Replies: 4
    Last Post: 02-23-2008, 04:38 PM
  3. Bandwidth usage
    By bobers in forum Free Hosting
    Replies: 5
    Last Post: 06-22-2005, 04:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers