How to allow access to only 1 page?

Is there a website in the local network, smart home and all that. It has API for VC and stuff :) the Website was moved from hosting on my car and now I sit and think :)
You need to allow access to the directory API all, and to the rest of the site to block access to all but the LAN devices...
Understand that you need to write a rule in htaccess but don't know how :(
March 20th 20 at 11:25
1 answer
March 20th 20 at 11:27
Solution
In the root directory create a file .htaccess and write:
Order Deny,Allow
Deny from all
Allow from 10.0.0.0/8
Allow from 100.64.0.0/10
Allow from 172.16.0.0/12
Allow from 192.168.0.0/16


in the api folder create a file .htaccess
Order Allow, Deny
Allow from all

Find more questions by tags htaccess