Per-file control is not available. Password protection can only be applied to a directory (folder); the password will apply to all the contents of that directory.
To protect an individual file, put the file into a directory by itself.
Before setting up password protection, ITD recommends that you understand the following:
The following steps will be completed in the directory you want to protect. The steps will be repeated for each directory you wish to protect.
frank $ cddirectory name
frank $ pico .htaccess(This creates the file then opens it in pico)
AuthNamecannot contain any empty spaces. If a space is needed, substitute an underscore ( _ ) character.
AuthUserFilecomplete path to your protected subdirectory
AuthNameyour name, course, organization, etc...
require userlist authorized person(s) here
require user John Smith
The file "classfile," located in Professor Smart's public_html folder, is available to John Smith.
The following command will create the encrypted password and a hidden file named .htpasswd. Username refers to the person receiving your permission to access the file ("John Smith" in the above example). The names should match exactly.
frank $ /usr/local/etc/httpd/support/htpasswd -c .htpasswd username
Change the permissions of the .htaccess and .htpasswd files to allow all users to
read and execute them.
frank $ chmod a+rx .htaccess
frank $ chmod a+rx .htpasswd