Results 1 to 2 of 2

Thread: .htaccess help?

  1. #1

    .htaccess help?

    I want to stop people hotlinking to my images and costing me bandwidth

    Heres a snip from my .htaccess

    # Rewrite
    AuthUserFile /dev/null
    AuthGroupFile /dev/null
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !>http://cpfc.org [NC]
    RewriteCond %{HTTP_REFERER} !>http://www.cpfc.org [NC]
    RewriteCond %{HTTP_REFERER} !>http://cpfc-online.com [NC]
    RewriteCond %{HTTP_REFERER} !>http://www.cpfc-online.com [NC]
    RewriteRule /* http://www.cpfc.org/bad.gif [R,L]
    Any idea why the above doesn't work- people are still hotlinking succesfully to images in my /forums directory

  2. #2
    Try this

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain.com [NC]
    RewriteRule [^/]+\.(exe|mpeg|mpg|avi|mp3|gif|jpg|JPG|GIF|MP3|AVI)$ - [F]
    RewriteRule ^/cgi-bin/.+$ - [F]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •