Lock down WordPress admin login with .htaccess
Posted: Thu Feb 25, 2016 4:31 am
Hi all, I having been trying to limit my admin area using .htcccess the issue i have have it that it doesn't seem to work fully.
This is the code i'm using.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^ip\.ip\.ip\.ip$
RewriteRule ^(.*)$ - [R=403,L]
</IfModule>
I have placed it in my .htaccess, when i test it, it appears to work if i don't include my Ip range it blocks access. Great!
However i'm still getting attacks which i can't understand, is the code wrong or in the wrong folder does anyone have any idea what i can do, or is this not a bullet proof method. any help much appreciated. Hope i have given enough information.
This is the code i'm using.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^ip\.ip\.ip\.ip$
RewriteRule ^(.*)$ - [R=403,L]
</IfModule>
I have placed it in my .htaccess, when i test it, it appears to work if i don't include my Ip range it blocks access. Great!
However i'm still getting attacks which i can't understand, is the code wrong or in the wrong folder does anyone have any idea what i can do, or is this not a bullet proof method. any help much appreciated. Hope i have given enough information.