Create a restricted area on your website

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”.

  1. Create a file in the directory of your website that you want to restrict access to. Name this file “.htaccess”
  2. Put the following code in the file:
    order deny,allow
    deny from all
    allow from 192.168.0.1
  3. 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!

Leave a Reply