-
-
Save jb510/9a8c978abc0dab7e5344 to your computer and use it in GitHub Desktop.
HTTP Password protection for WPE
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
Order deny,allow | |
# Detect the domain host and set a variable telling us to use auth | |
SetEnvIf Host wpengine.com$ S9_USE_AUTH | |
#SetEnvIf Host staging.wpengine.com$ S9_USE_AUTH | |
# Detect the variable telling us to use auth and deny | |
Deny from env=S9_USE_AUTH | |
Satisfy any | |
# Basic authentication | |
AuthType Basic | |
AuthName "Nothing to see here. Move along, please" | |
Require valid-user | |
# N.B. This path will be specific to your server setup, if this file doesn't exist server will 500. | |
#AuthUserFile /nas/wp/www/sites/__instancename__/.htpasswd | |
#AuthUserFile /nas/wp/www/staging/__instancename__/.htpasswd | |
# Don't allow the .htpasswd file to be shown to web users | |
<Files .htpasswd> | |
Order allow,deny | |
Deny from all | |
Satisfy All | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment