Spefic Image Hotlink protection

Discussion in 'Apache' started by MilesB, Jan 5, 2008.

  1. #1
    There is a specific image on my site being hotlinked. How do I make it so an image from a different website is hotlinked instead of that specific one. I just want to make people see a scary image instead of looking at mine.

    I have a hotlink code now but it works on all images but Instead I just want it working on only one
     
    MilesB, Jan 5, 2008 IP
  2. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #2
    crazyryan, Jan 5, 2008 IP
  3. MilesB

    MilesB Well-Known Member

    Messages:
    1,813
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    180
    #3
    Didnt work
     
    MilesB, Jan 5, 2008 IP
  4. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #4
    Post what you have that works with all images, and post the address to the image you want it to work on.
     
    joebert, Jan 6, 2008 IP
  5. MilesB

    MilesB Well-Known Member

    Messages:
    1,813
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    180
    #5
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpeg [L]


    I want the hotlink protection to only work on http://animeomnitude.com/content/reviews/beck/beck.jpg
     
    MilesB, Jan 7, 2008 IP
  6. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #6
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
    RewriteRule beck\.jpg$ /images/nohotlink.jpeg [L]
    Code (markup):
    Place it in the htaccess of the /content/reviews/beck/ directory.
     
    joebert, Jan 7, 2008 IP