Created
June 9, 2018 22:50
-
-
Save emarthinsen/11400c0018e1adc8626b6a5f645724f2 to your computer and use it in GitHub Desktop.
.htaccess - take 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the REQUIRE_AUTH environment variable if we should password protect | |
SetEnv NO_AUTH 1 | |
SetEnvIfNoCase HOST staging !NO_AUTH | |
SetEnvIfNoCase Request_URI ^/privacy-policy$ NO_AUTH | |
RewriteRule ^ https://www.google.com$%{ENV:NO_AUTH} [L,R=302] | |
# Define the basic auth setup | |
AuthType Basic | |
AuthName "Staging Area" | |
AuthUserFile /var/app/current/public/.htpasswd | |
# Allow all access if NO_AUTH or a valid user | |
<RequireAny> | |
Require env NO_AUTH | |
Require valid-user | |
</RequireAny> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment