Skip to content

Instantly share code, notes, and snippets.

@dlangille
Created January 7, 2015 22:47
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 dlangille/2ef8eb8e339a929647b4 to your computer and use it in GitHub Desktop.
Save dlangille/2ef8eb8e339a929647b4 to your computer and use it in GitHub Desktop.
Give a 404 for certain IP ranges when they try to login
<Directory "/path/to/wordpress/">
AllowOverride AuthConfig
Options ExecCGI FollowSymLinks
Order allow,deny
Allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^188.143.234. [OR]
RewriteCond %{REMOTE_ADDR} ^188.143.235.
RewriteRule ^wp-login.php / [R=404]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment