Hello
Here is my .htaccess file:
RewriteCond %{HTTP_REFERER} ![url]http:///url?mysite.(net|com) [NC]
RewriteRule .(zip|rar|exe|tar|tgz|gz)$ - [NC,F]
Ok, problem solved, nobody can link to my downloads. Even my own users who's HTTP_REFERER is blank
BUT, if I add the following line:
RewriteCond %{HTTP_REFERER} !$
THen those users will be able to download my files, BUT, direct type ins will also work.
My question is
1) How can I password protect the /download directory so that PHP will send the correct Apache user + password in the header (Location...) part of the script?
I was told that HTTP_REFERER was imperfect, and in fact, it is.
So I was told to password protect the directory, sounds a good idea
But how can I make this transparent for my users?
I mean, I want them to see the page, go click on a "Download" button, and the download should start
Mozilla users will be able to see the complete URL in their Download Manager, however, if they type it directly, they should get a "User and Password required".
So this should be the perfect solution, featuring:
1) Permission for my users with HTTP REFERERS
2) Permission for my users with blank HTTP REFERERS
3) Denial to direct type ins
4) Denial to linking from other sites
Any suggestion will be appreciate, I've been googling and php.netting for around 1:30 hours with no clue how to do this.
I just know that aparently you can't modify the HTTP_REFERER variable, so I'm in trouble.
And I don't know how to send the PHP_AUTH_USER and PASS with PHP.
Regards
Xavier