Skip to content

Instantly share code, notes, and snippets.

@emarthinsen
Created June 9, 2018 21:29
Show Gist options
  • Save emarthinsen/2837dee0c66cce24f8051370c0160ba7 to your computer and use it in GitHub Desktop.
Save emarthinsen/2837dee0c66cce24f8051370c0160ba7 to your computer and use it in GitHub Desktop.
.htaccess - take 2
# These two statements will correctly set REQUIRE_AUTH to 1 or nothing
SetEnvIfNoCase HOST staging REQUIRE_AUTH
SetEnvIfNoCase Request_URI ^/privacy-policy$ !REQUIRE_AUTH
AuthType Basic
AuthName "Staging Area"
AuthUserFile /var/app/current/public/.htpasswd
Require valid-user
Order Allow,Deny
Allow from All
Deny from env=REQUIRE_AUTH
Satisfy any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment