Skip to content

Instantly share code, notes, and snippets.

@huntlyc
Last active December 16, 2015 03:48
Show Gist options
  • Save huntlyc/5372228 to your computer and use it in GitHub Desktop.
Save huntlyc/5372228 to your computer and use it in GitHub Desktop.
wp-login.php protection
#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