Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Apache htaccess authentication (See related posts)

For setting up a quick protected directory, put this in .htaccess

AuthName "Some Admin Area"
AuthType Basic
AuthUserFile /home/someclient/public_html/admin/.htpasswd
require valid-user


And then create the .htpasswd file via
htpasswd -c .htpasswd someuser


You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts