Results 1 to 3 of 3
Thread: Hotlinking and .htaccess
-
05-03-2005, 06:49 PM #1Junior Guru Wannabe
- Join Date
- May 2003
- Posts
- 44
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
-
05-04-2005, 11:09 AM #2Design and Hosting Solutions
- 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
-
05-04-2005, 11:17 AM #3WHT Addict
- Join Date
- Jan 2005
- Posts
- 133
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.