1
votes

i have certain pages in my website that i would like to only be accessed from the LAN which is within my organization... now those pages are a part of my website because they interact with the database and all... how to do it

Now i can make them password protected... but i want to make them inaccessible to the rest of the internet and only display them (without password auth.) and links to them in other pages when they are opened from a subnet\LAN of the company...

HOW TO DO IT....

what if i want to extend this from one subnet to multiple subnets like a ACL- Access Control List

2
First, this is absolutely dependent on the server software you are using, so please specify that. Also - this is off topic to SO as it is not programming related. Voting to move to ServerFault.com, though you may have better luck asking on webmasters.stackexchange.comOded

2 Answers

2
votes

If you use apache server you can use rewrite mode in .htaccess file.

RewriteCond %{REMOTE_ADDR} ^12\.34\.56\.78$ [OR]
RewriteCond %{REMOTE_ADDR} ^87\.65\.43\.21$
RewriteRule .* - [F]

In this example you block two IP adresses, you can use Regular Expressions to block IP adresses outside your network.

0
votes

One possible approach would be to allow access from a limited set of IP.