.htaccess Password Protect


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. For server path info, save as phpinfo.php:
  2.  
  3. <?php
  4. ?>
  5.  
  6. .htaccess:
  7.  
  8. AuthName "Restricted Area"
  9. AuthType Basic
  10. AuthUserFile /home/path/to/folder/.htpasswd
  11. AuthGroupFile /dev/null
  12. require valid-user
  13.  
  14. .htpasswd in root dir:
  15.  
  16. admin:[encrypted password]
  17.  
  18. Generate encrypted password here: http://tools.dynamicdrive.com/password/

URL: http://tools.dynamicdrive.com/password/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.