1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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://.*mysite.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://ip.ip.ip.ip/.*$ [NC]
    RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.mysite.com/ [R,L]
  2. lord

    lord Junior Member

    Jan 21, 2009
    Likes Received:
    try this
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://yousite.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.yousite.com/ [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)$ http://www.yoursite.com/GTFO.jpg [R,L]