Created
December 5, 2012 19:59
-
-
Save david4worx/4218973 to your computer and use it in GitHub Desktop.
.htaccess basic auth
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
RewriteEngine On | |
RewriteBase / | |
# DO match the following url(s) | |
SetEnvIf Request_URI ^(?!<insertYourUrlHere>$) noauth=1 | |
# the auth block | |
AuthName "Please login." | |
AuthType Basic | |
AuthUserFile <insertYourPasswordFileHere> | |
# Here is where we allow/deny | |
Order Deny,Allow | |
Satisfy any | |
Deny from all | |
Require valid-user | |
Allow from env=noauth |
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
RewriteEngine On | |
RewriteBase / | |
# DO match the following url(s) | |
SetEnvIf Request_URI ^(<insertYourUrlHere>$) doauth=1 | |
# the auth block | |
AuthName "Please login." | |
AuthType Basic | |
AuthUserFile <insertYourPasswordFileHere> | |
# Here is where we allow/deny | |
Order Deny,Allow | |
Satisfy any | |
Deny from all | |
Require valid-user | |
Allow from env=doauth |
Author
david4worx
commented
Dec 5, 2012
RewriteEngine On
RewriteBase /
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment