Skip to content

Instantly share code, notes, and snippets.

@hiranthi
Last active December 18, 2015 14:18
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 hiranthi/5795854 to your computer and use it in GitHub Desktop.
Save hiranthi/5795854 to your computer and use it in GitHub Desktop.
# Place this below the .htaccess code from https://onexa.nl/nieuwsberichten/brute-force-attacks-wp-login-php-verminderen/
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{QUERY_STRING} !(^|&)secure=XXXXXXXXX($|&)
RewriteCond %{REQUEST_URI} .wp-admin* [OR]
RewriteCond %{REQUEST_URI} .wp-login\.php*
RewriteCond %{HTTP_REFERER} !.*domain.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) http://%{REMOTE_ADDR}/ [R=301,L]
</ifModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment