Ok, you can block the whole site first and then just enable / api.
<LocationMatch />
Order Deny,Allow
Deny from all
Allow from [MY IP]
</LocationMatch>
<LocationMatch /api>
Order Deny,Allow
Allow from all
</LocationMatch>
Sorry, I couldn’t verify it due to the way XAMPP was configured on my PC. Pray for it.
source
share