Last active
December 16, 2015 03:48
-
-
Save huntlyc/5372228 to your computer and use it in GitHub Desktop.
wp-login.php protection
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
#How to get this to work... | |
#First create your password file: | |
# - Replace $FILE and $USER with your values | |
# $> htpasswd -c $FILE $USER | |
#This goes into your apache config | |
# - Replace /PATH/TO/$FILE with the full path (incl file) to your | |
# created password file | |
<Files "wp-login.php"> | |
AuthUserFile /PATH/TO/$FILE | |
AuthName "Wordpress Protection" | |
AuthType Basic | |
require valid-user | |
</Files> | |
#### EXAMPLE USE #### | |
# | |
# user@comp:/home/bob> htpasswd -c htpwd test | |
# | |
<Files "wp-login.php"> | |
AuthUserFile /home/bob/htpwd | |
AuthName "Wordpress Protection" | |
AuthType Basic | |
require valid-user | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment