Skip to content

Instantly share code, notes, and snippets.

@jalal
Created March 26, 2014 14:57
Show Gist options
  • Save jalal/9785258 to your computer and use it in GitHub Desktop.
Save jalal/9785258 to your computer and use it in GitHub Desktop.
Short piece of Apache config to stop Wordpress brute force login attempts (for .htaccess)
# added by jalal to stop brute force login attempts
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .(wp-comments-post|wp-login)\.php*
RewriteCond %{HTTP_REFERER} !.*domain.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]
# end brute force handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment