Articles & Code Snippets

Authentication with .htpasswd On Mac OS X

Authentication with .htpasswd On Mac OS X

Open Terminal and type:
$ htpasswd -c /www/ yourusername
After running the command it will ask for your password.
Create a .htaccess file at the directory you want to protect, suppose /www/ With the following lines:
AuthName "Login"
AuthUserFile /www/
AuthGroupFile /dev/null
AuthType Basic< LIMIT GET POST >require valid-user< /LIMIT >
Now save .htaccess and try running the page, that's it! web


Just feel like saying Hi?

  1 (903) NEGRARU phone