Q:

download page/folder privacy with .htaccess?

I have a private folder on my domain like 
http://example.com/protected
and i stored lot of images and pdf file there
 /protected/pad1.pdf
 /protected/pad2.pdf
 /protected/pad1.png
 /protected/pad1.png

supose these are the files, how can i hide or protect access to there files with the help of .htaccess file.
allow only users those who knows the password.
is it possible ???

A:

Check out Apache's page on Authentication, Authorization and Access Control -- one method would be using Basic or Digest authentication. That would look something like this:
AuthType Digest
AuthName "Private files"
AuthDigestFile /usr/local/apache/passwd/digest
Require user (usernames here)

Of course, you need to generate a password and/or digest file using htdigest or htpasswd as well, but that procedure is explained in the document I linked to.

