0

In running a wordpress site, the client wanted to restrict /wp-admin to a certain IP range, but yet, allow wp-admin/admin-ajax.php so that one plugin continues to function properly.

I've worked with this but no luck.

<Location "/wp-admin">
Order Allow,Deny
allow from xxx.yyy.0.0/16
allow from aaa.bbb.0.0/16
</Location>

<Files "wp-admin/admin-ajax.php">
allow from all
</FIles>

<Files "wp-login.php">
Order Allow,Deny
allow from xxx.yyy.0.0/16
allow from aaa.bbb.0.0/16
</Files>

I have also swapped out <Location> with <Directory> to no luck either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.