Last active
August 29, 2015 14:16
-
-
Save marceloxp/08428147b980ab4ac188 to your computer and use it in GitHub Desktop.
Apache conditional .htpasswd
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
SetEnvIf Host .*local.yetanothersite.* VAR_LOCAL_SITE | |
SetEnvIf Host .*yetanothersitehomolog.com.br.* VAR_HOMOLOG_SITE | |
SetEnvIf Host .*www.yetanothersite.com.br.* VAR_PROD_SITE | |
Order Deny,Allow | |
AuthUserFile /var/../.htpasswd | |
AuthName "Authorized personnel only." | |
AuthType Basic | |
Require valid-user | |
Allow from env=VAR_LOCAL_SITE | |
Allow from env=VAR_HOMOLOG_SITE | |
Deny from all | |
Satisfy any | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteRule ^$ app/webroot/ [L] | |
RewriteRule (.*) app/webroot/$1 [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment