Need Help > .htacces anti leech problem

Discussion in 'General Programming Chat' started by 19w08, Feb 17, 2009.

  1. 19w08

    19w08 Guest

    Hi Guys,

    This is what i am trying to use to protect my gfx for a new project.

    But im guessing that i am doing something wrong cause when i try to acces
    my files i get a Forbidden problem.

    So i guess it works to good :D

    Now i know a little bit of .htacces but i cant figure this one out.
    Anyone an idea?

    AuthUserFile /dev/null
    AuthGroupFile /dev/null
    RewriteEngine On
    RewriteOptions inherit
    RewriteCond %{HTTP_REFERER} !^http://.**$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://ip.ip.ip.ip/.*$ [NC]
    RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ [R,L]
  2. lord

    lord Junior Member

    Jan 21, 2009
    Likes Received:
    try this
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^ [NC]
    RewriteCond %{HTTP_REFERER} !^ [NC]
    RewriteRule [^/]+.(gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG)$ - [F]

    bonus (if you want them to see an image or something):
    RewriteRule [^/]+.(gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG)$ [R,L]