Forum Moderators: phranque

Message Too Old, No Replies

.htaccess and downloads

How do I get APache to ask for auth before it allows a download?

         

IRPnet

3:43 pm on Apr 2, 2004 (gmt 0)



Hi all,
Searched, can't find this - so here goes.
Currently I have:

<Directory "z:/whatever/">
AuthType Basic
AuthName "For access to IRPnetFTP-on-the-web type"
AuthUserFile .htpasswd
<FilesMatch "*\.(zip¦ZIP¦rar¦RAR)">
Order Allow,Deny
Allow from All
Deny from www.anyurl.com
<Limit GET >
require valid-user
</Limit>
</FilesMatch>
</Directory>

What I'm trying to do is when someone attempts to download one of the above types of file, it asks for the auth info (user:pass) before allowing download. Will the above work, or should I be looking at CGI to do the job?

jdMorgan

11:37 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IRPnet,

Welcome to WebmasterWorld [webmasterworld.com]!

That looks like it should work. You probably don't need the <Limit GET> container, though.

Jim