Monday, September 1, 2014

Apache Uthentication for single Page

If you don’t current have an .htpasswd, use the “-c” option to create the file with the first user. It will prompt you for a password and encrypt it for you.

htpasswd -c /var/www/domain.com/public_html/.htpasswd user1

Copy and Paste following in .htaccess (Change path and file name according to your ewquirement)
AuthUserFile /PATH-TO-HTPASSWD/.htpasswd
  AuthName "My restricted Area"
  AuthType Basic
# ErrorDocument 401 /test.php
  <Files "vox-videos.html">
   require valid-user
   </Files>