Last active
September 6, 2019 06:48
-
-
Save daubac402/df0203f6ffc204eff3739c16e5d4a7b3 to your computer and use it in GitHub Desktop.
.htaccess - Require basic authen for specific path
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
# Condition | |
SetEnvIf Request_URI ^/your_secure_path auth=1 | |
# Basic Authen | |
AuthName "Basic Auth" | |
AuthType Basic | |
AuthUserFile "/path/to/my/.htpasswd" | |
# first, allow everybody | |
Order Allow,Deny | |
Satisfy any | |
Allow from all | |
Require valid-user | |
# then, deny only if required | |
Deny from env=auth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment