Skip to content

Instantly share code, notes, and snippets.

@bransinanderson
Created July 13, 2017 13:14
Show Gist options
  • Save bransinanderson/04bee5a11fbae794d0abc41641c3b6f6 to your computer and use it in GitHub Desktop.
Save bransinanderson/04bee5a11fbae794d0abc41641c3b6f6 to your computer and use it in GitHub Desktop.
Protect development environments via htaccess and htpasswd
SetEnvIf Host staging.example.com passreq
AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/staging.example.com/html/.htpasswd
Require valid-user
Order allow,deny
Allow from all
Deny from env=passreq
Satisfy any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment