Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active May 17, 2017 17:15
Show Gist options
  • Select an option

  • Save fedir/6899180 to your computer and use it in GitHub Desktop.

Select an option

Save fedir/6899180 to your computer and use it in GitHub Desktop.
Protection with .htpasswd / .htaccess
AuthName "Password Protect Directory"
AuthType Basic
AuthUserFile /home/www/site/.htpasswd
<Limit GET POST PUT>
Require valid-user
</Limit>
htpasswd -c /home/www/site/.htpasswd username
<Directory "/var/www/html">
AuthName "Password Protect Directory"
AuthType Basic
AuthUserFile /home/www/site/.htpasswd
<Limit GET POST PUT>
Require valid-user
</Limit>
</Directory>
AuthName "Password Protect Directory"
AuthType Basic
AuthUserFile /home/.htpasswd
Require valid-user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment