Results 1 to 3 of 3
  1. #1

    Hotlinking and .htaccess

    I am trying to prevent people from linking directly to the files that I have for download...

    So I am using the following code in the htaccess file..

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain1.com(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?forum.domain.com(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain2.com(/)?.*$ [NC]
    RewriteRule .*\.(zip|ZIP|dll|DLL|ocx|OCX)$ http://www.domain.com [R,NC]

    Now I tested this and it works fine in IE based browsers. If you have a link directly to a file from an outside site it takes you to the specified domain instead. However it wont work in Mozilla Firefox, it still lets you download the file. Why? How can I fix it?

    Thanks

  2. #2
    Join Date
    May 2005
    Location
    New York
    Posts
    737
    you have configured it to allow download if there is no referrer passed ( which can be dodgy too ) so perhaps firefox is set to not pass on any referrer

  3. #3
    Remove the check for the null referrer. Many browsers and firewalls, in addition to privacy suites, omit this, and can make life hell for those users who don't have their systems passing such headers.

Posting Permissions

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