.htaccess LAN only folders

I run a small local web server with apache, php and mysql for me to learn php on without having to upload a page to a host every time i want to test it. Usually the server is locked off the internet courtsey of the firewall and is only accessible over the LAN (3 machines) but ive come to the point where i want to make a couple of areas public.

Problem is most of the pages are designed for lan only access and as such dont require any passwords to change any data, etc. I know i can add .htaccess passwords to folders i dont want to be public but i really dont want to have to type in the pass every time i want to go to a private area because i use it a lot.

I remember seeing somewhere i could use .htaccess to restrict access if someones IP didnt fall between a certain range but i dont know how and cant find it in the apache documentation. Using this i could restrict to lan only to certain folders and leave others public.

Can someone give the .htaccess code that will give a 403 forbidden if their IP isnt a LAN address (or whatever the error is)

Many thanks. Ima.

 

 

 

 

Top