PHP - how to make page visible only in local network

arclite picture arclite · May 4, 2012 · Viewed 21.4k times · Source

Hi i've got another question, i'm writing a simple website in PHP and i have problem with visibility of my website in local network to make it visible to remote addresses i used

$_SERVER['REMOTE_ADDRESS']

, but i want to make it visible in my LAN.

How can i do this ??

Answer

evaldasc picture evaldasc · Nov 22, 2012

also in .htaccess you can allow from your ip/subnet, like this:

Order Deny,Allow
Deny from all
Allow from 192.168.1.1/24

of course it should match your LAN