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
<Directory> to no luck either.