Created
July 26, 2017 23:19
-
-
Save archatas/8ea19b61a06f1a77629386780758732a to your computer and use it in GitHub Desktop.
Allow access to a website only to specific user agents or visitors with authentication credentials
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 User-Agent ^VipAgent1 vip_agent | |
SetEnvIf User-Agent ^VipAgent2 vip_agent | |
Order Allow,Deny | |
Allow from env=vip_agent | |
AuthType Basic | |
AuthName "Protected Login" | |
AuthUserFile /path/to/htpasswd | |
Require valid-user | |
Satisfy any |
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
#... | |
LoadModule authn_file_module libexec/apache2/mod_authn_file.so | |
LoadModule rewrite_module libexec/apache2/mod_rewrite.so | |
LoadModule setenvif_module libexec/apache2/mod_setenvif.so | |
#... | |
AllowOverride All |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment