If your website is running on an Apache server, its very easy to restrict access to a folder to only yourself or a select few people. This is very useful if parts of your site are not yet fully operational, or if you want to run a small “beta”.
- Create a file in the directory of your website that you want to restrict access to. Name this file “.htaccess”
- Put the following code in the file:
order deny,allow
deny from all
allow from 192.168.0.1 - Replace “192.168.0.1″ with the ip address of the person you’re trying to block. If you’d like to allow multiple IP addresses, add as many <code> allow from <ip address> </code> lines as you want to the end of the file.
If you enjoyed this post, make sure you subscribe to my RSS feed!
