• 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 all

    4
    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)

    • This topic was modified 7 years, 6 months ago by tvrhossain.
Viewing 1 replies (of 1 total)
  • Uros Tasic

    (@wpaurorautasic)

    If you use localhost, the chance of someone looking your site is minimal not to say “impossible”. Later when your site is online if you never done such a thing a recommend using some of the security plugins that can handle this code for you.

    Detailed explanation on how to work with htaccess is on this link on WordPress codex.

Viewing 1 replies (of 1 total)
  • The topic ‘Many Ways!! to Limit Access to Admin Area’ is closed to new replies.