Htaccess Programming Tips & Tricks





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Code Snippets
 List All
 301 Redirect
 404 Redirect
 Htaccess Redirection
 Security
 




Password protection For Directory - Htaccess

Snippets  Htaccess  Password protection For Directory
Snippet On
Password protection




Code
  
Rate this page :
  [ 0 votes]

This code about password protection for directory.Copy, Paste this htaccess code in .htaccess file and place this file under directory for which you want to protect. And paste the .htpasswd code in .htpasswd file and place it under folder for which mentioned in AuthUserFile.

.htaccess
----------
AuthType Basic
AuthName "test.com admin"
AuthUserFile /home/test/password/.htpasswd
Require user admin


.htpasswd
----------
admin:$kjl$1e$fd0h...$NvYe1




Other Links

web hosting