• I want to restrict access to this directory. I have one plugin that uses ajax.php for measuring stats (outbound links) that keeps me from blocking it off entirely except to my IPs for my machines.

    I think if I specify the referrer as the site itself being allowed that would enable the stats script. Not sure how to write it.

    Sample apache server directive with Centos

    <Directory “/var/www/html/sites/xxxx/wp-admin/”>
    Order Deny,Allow
    Allow from nn.nnn.n.0/16
    Allow from nn.nn.nnn.nnn
    Deny from all
    </Directory>

Viewing 1 replies (of 1 total)
  • Thread Starter craig.keefner

    (@craigkeefner)

    The stats plugin I am using is Slimstats. I think the below should work.

    SetEnvIf Referer “^https://website\.org/wp-admin/” slimstat
    <Directory /website/wp-admin>
    Order Deny,Allow
    Deny from all
    Allow from env=slimstat
    Allow from nnn.nnn.nnn.nnn <– my PC admin–>
    </Directory>

Viewing 1 replies (of 1 total)
  • The topic ‘Restricting Access to wp-admin via server directive or htaccess’ is closed to new replies.