Many Ways!! to Limit Access to Admin Area
-
Hello, I want to restrict access to wplogin page from specific address,For now I m testing it in localhost. I have found DIFFERENT version of htaccess directives to use in this case, I m confused, This is what I found :
1. <Files wp-login.php>
order deny,allow
Deny from all
# whitelist West Palm Beach IP address
allow from xx.xxx.xx.xx
</Files>2.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123$
RewriteRule ^(.*)$ – [R=403,L]
</IfModule>3.
order deny,allow
allow from your.IP.address
deny from all4
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName “WordPress Admin Access Control”
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
# whitelist Syed’s IP address
allow from xx.xx.xx.xxx
</LIMIT>Which one should I use for my localhost ? (I will just change the external ip address in my production server later)
- The topic ‘Many Ways!! to Limit Access to Admin Area’ is closed to new replies.