0

I was trying to block the access from public to my /wp-admin. I can achieve it by doing the following htaccess but the problem is I need to add an exception for sub-url which is /wp-admin/admin-ajax.php How can I do that? Thanks in advance!

RewriteCond %{REQUEST_URI} ^(.*)?wp-admin(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteRule ^(.*)$ - [R=403,L]
2
  • 3
    Although you are using WordPress, this is purely an Apache/htaccess question really and you'll probably get a quicker answer asking it over on Stack Overflow Oct 14, 2016 at 10:32
  • haha thanks I posted in stackoverflow first. But even he I got a comment from you but no replies from there yet
    – zaw
    Oct 15, 2016 at 3:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.