Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasperf/acba59a1f0acf9b2e796 to your computer and use it in GitHub Desktop.
Save jasperf/acba59a1f0acf9b2e796 to your computer and use it in GitHub Desktop.
.htaccess authentication to protect wp-login.php against brute force attacks without blocking the whole site #wordpress #security #htaccess
#http://tools.dynamicdrive.com/password/
AuthType Basic
AuthName "Graag twee keer login invoeren en daarna standaaard WordPress login"
AuthUserFile /path/to/file/.htpasswd
<Files wp-login.php>
Require valid-user
</Files>
#Dreamhost required this directive above WP directive
#http://wiki.dreamhost.com/Password-protecting_directories#Password_Protecting_Directories_within_WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(failed_auth\.html).*$ [NC]
RewriteRule . - [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment