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]