Skip to content

Instantly share code, notes, and snippets.

@ogrosko
Last active October 14, 2019 09:45
Show Gist options
  • Save ogrosko/dea16bad58a028e2c1215b7e7fdeac6e to your computer and use it in GitHub Desktop.
Save ogrosko/dea16bad58a028e2c1215b7e7fdeac6e to your computer and use it in GitHub Desktop.
Password protected host
#Protected hosts by password
<If "%{HTTP_HOST} in { 'hotst.name.com' }">
AuthType Basic
AuthName "Password Protected"
AuthUserFile /var/www/html/.htpasswd
Require valid-user
</If>
#Protected hosts by password and env variable
<If "!(%{ENV:TYPO3_CONTEXT} in {'Development/DDev', 'Testing'})">
AuthType Basic
AuthName "Password Protected"
AuthUserFile /var/www/html/.htpasswd
Require valid-user
</If>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment