Limit Access to Local Area Network Using htaccess

Recently I have posted several articles describing the use of the .htaccess file.

In this post I will explain how can we limit the access of the website to Local Area Network only.

You can specify the IP range for which you want to allow the access.

You need to place the below code in .htaccess file.

# limit access to local area network only order deny,allow deny from all allow from 192.168.0.0/111 # This will limit the access only from 192.168.0.0 to 192.168.0.111
# limit access to local area network only
<Limit GET POST PUT>
 order deny,allow
 deny from all
 allow from 192.168.0.0/111
# This will limit the access only from 192.168.0.0 to 192.168.0.111
</Limit>

Related Posts

Written by Avinash

Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.

View all posts by: