HELP! I need help with hotlinking

Discussion in 'HTML & Website Design' started by mike10, Mar 13, 2010.

  1. #1
    Hi,
    My bandwidth usage has skyrocketed recently and I am getting threatening emails from my hosting company. I haven't seen any significant spike in my traffic, so I looked through the log and found out there are tons of chinese websites hotlinking to my images. I want to block them using the following code in my htaccess file

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^http://(.+\.)?badsite\.com/ [NC,OR]
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://mysite.com/dont-hotlink-me.gif [L]

    But my problem is there are a ton of sites hotlinking to my site. I can block all sites with RewriteCond %{HTTP_REFERER} !^$, but I don't want to block friendly sites and there are a lot of them too. The good thing is that all these sites have similar name such as "http://www.badsite1.com", http://www.badsite2.com etc. Is there a command in the htaccess where I can block sites with similar names (i.e. all sites that start with http://www.bad... or http://bad...")

    Thanks you in advance.


    Regards,
    Mike
     
    mike10, Mar 13, 2010 IP
  2. sylverCode

    sylverCode Member

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    If you use cPanel you can easily do it by adding friendly sites' url to the "allow access" section.
     
    sylverCode, Mar 14, 2010 IP
  3. mike10

    mike10 Active Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Thanks for the reply Sylver. I host with godaggy, and I don't think they offer cPanel
     
    mike10, Mar 14, 2010 IP
  4. iwtmmo

    iwtmmo Active Member

    Messages:
    832
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Try to install website firewall script.
     
    iwtmmo, Mar 14, 2010 IP