How to make a file password protected

 Home / Uncategorized / How to make a file password protected
07Jan, 2013
0

How to make a file password protected

You need to use htaccess to make a single file password protected and add these lines in to it.

<FilesMatch file.php>
AuthName “Restricted Area”
AuthType Basic
AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
require valid-user
</FilesMatch>

then run command

htpasswd -b .htpasswd username password


About The Author

Read more