Monday, January 18, 2010

Restrict accessing your site for some users based on their IP Address

In .htaccess add below lines

Order allow, deny
Deny from
Deny from
Allow from all

It is allowed accessing for all except fom IPs,,,

OR if you want to access your site from your IP only add below lines in .htaccess file

Order deny, allow
Deny from all
Allow from

This will be usefull for your site administrators.
If you set this for site admin, then the administrator can access admin area from the mentioned IP only.