Created
May 28, 2013 13:42
-
-
Save designermonkey/5662845 to your computer and use it in GitHub Desktop.
Set http auth per domain: Apache 2.2
This file contains hidden or 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
| # Check for the hostname here | |
| SetEnvIfNoCase HOST ^(www\.)?website\.co\.uk$ PROTECTED_HOST | |
| <Directory /path/to/htdocs> | |
| AuthType Basic | |
| AuthName "Authentication" | |
| AuthUserFile /path/to/.htpasswd | |
| Order Deny,Allow | |
| Satisfy any | |
| Deny from all | |
| Require valid-user | |
| Allow from env=!PROTECTED_HOST | |
| </Directory> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allows all domains other than the one specified in the
PROTECTED_HOSTvariable.