Web Hosting - Dedicated Servers
Dedicated Server Hosting
Web Hosting eCommerce Hosting Reseller Hosting Dedicated Server
Home

Restrict Directory Access by IP Address

Written by Website Tutorials   
Tuesday, 15 May 2007

This can be a very effective way to protect your Joomla! administrator directory. Any other directory in public_html can be protected in the same way. This method only works if you have a static IP address assigned to you. Anyone attempting to browse such directories using a different IP Address will get a 403 Forbidden error.

How To Restrict Directory Access by IP Address

1. In the directory you wish to protect, open (or create) a file called, .htaccess. (Note the dot at the beginning of the file name.)

2. Add the following code to this file, replacing 100.100.100.100 in this example with the static IP address you plan to allow:

Order Deny,Allow
Deny from all
Allow from 100.100.100.100

3. Optional: You can enter partial IP Addresses, such as, 100.100.100. This allows access to a range of addresses.

4. Optional: You can add multiple addresses by separating them with comma's.

100.100.100.101, 100.100.100.102




If you found this tutorial helpful, you can bookmark it with your favourite tracker.

Reddit!Del.icio.us!Google!Live!Facebook!Slashdot!Netscape!Technorati!Blinklist!Yahoo!Ma.gnolia!Squidoo!
 
< Prev   Next >
 
 
RedHat Linux
cPanel Hosting
plesk windows
Fantastico SiteBuilder
 

AUSWEB Web Hosting PTY LTD © 2008 Network Info Data CenterPrivacy PolicySLA Terms and Conditions