To limit specific IP to access website is easy with .htaccess. Just follow the steps below and you will be able to set your website to be view by specific IP only.
- Create a file and name it .htaccess with the content below:
order deny,allow
deny from all
allow from 192.168.1.10Please change 192.168.1.10 to the IP you want to allow.
- Once the file is created, put it at your root directory. (This will be in http://www.yourdomain.com/.htaccess)
- Done! Now your website is can only be access by the IP you set!
- If you want to allow multiple IP address to access your website, just create another record of IP like below:
order deny,allow
deny from all
allow from 192.168.1.10
allow from 112.168.1.10
allow from 132.168.1.10