junrillg
11/17/2014 - 12:23 PM

HTACCESS: Restrict IP

HTACCESS: Restrict IP

#The .htaccess fi le can also be used for security purposes. Using .htaccess allows you to restrict
#access to your website by IP address, essentially locking it down from anonymous visitors. To lock
#down your website by IP addresses, add the following code to your .htaccess file:

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Access Control"
AuthType Basic
order deny,allow
deny from all
#IP address to whitelist
allow from xxx.xxx.xxx.xxx