php.htaccesslan

PHP - how to make page visible only in local network


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 ??


Solution

  • 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