Preventing specified sites from hotlinking

Discussion in 'Site & Server Administration' started by Phate, Mar 8, 2007.

  1. #1
    Hi, I was wondering whether it's possible to specify which domains you would like to prevent from hotlinking images on your site.
    I know how to specify which sites I want to allow but as I only want to block one domain I need to know how to do it the other way around.
     
    Phate, Mar 8, 2007 IP
  2. Estevan

    Estevan Peon

    Messages:
    120
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    0
    #2
    hello
    if you are running apache add this in htaccess

    RewriteCond %{HTTP_REFERER} ^h ttp://(.+\.)?block2\.com/ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^h ttp://(.+\.)?block1\.com/ [NC]
    RewriteRule .*\.(png|jpeg|jpg)$ h ttp://.site.com/error.gif [L]
     
    Estevan, Mar 9, 2007 IP
    Phate likes this.
  3. Phate

    Phate Peon

    Messages:
    131
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a lot :D
     
    Phate, Mar 9, 2007 IP
    d16man likes this.