Allow specific IP via htaccess

By placing the following code in your .htaccess file, you can block access to your website from everyone except the IP addresses you specify.
This can be particularly useful if your website is under construction and you don’t want other visitors to see the site, or have search engine spiders indexing pages that are not yet completed.

In this way you will also avoid hotlinking getting all your bandwidth,

<Limit GET POST PUT>
order deny,allow
deny from all
allow from 192.168.10.5
</Limit>

If you want to allow more IPs just add them after the 1st one like:

<Limit GET POST PUT>
order deny,allow
deny from all
allow from 192.168.10.5
allow from 192.140.20.5
</Limit>

Posted on: 29/07/2010








0 Comments
If you want to leave a comment please Login or Register
Playing with printer......
Allow specific IP via htaccess......
How to find large directories......