Locking a directory
Posted by: hingsmaf003 (---.dyn.optonline.net)
Date: September 14, 2008 04:54PM

I was wonderidng if it would be possible to lock a directory on a website only allowing certain ips to view the contents. How would i do that?

Options: ReplyQuote
Re: Locking a directory
Posted by: toivo (---.nsw.bigpond.net.au)
Date: September 14, 2008 10:49PM

Hi,

You can add an .htaccess file to the directory and use the allow directive:

[httpd.apache.org]

Regards,

toivo
Sydney, Australia

Options: ReplyQuote
Re: Locking a directory
Posted by: hingsmaf003 (---.dyn.optonline.net)
Date: September 15, 2008 04:32AM

ive tried that for some reason it just gives me a forbidden error and ive checked the ip and it doesnt work either

Options: ReplyQuote
Re: Locking a directory
Posted by: toivo (---.belrs3.nsw.optusnet.com.au)
Date: September 15, 2008 10:58AM

Here is an example from a working system, to restrict access to the admin folder to IP addresses in the LAN:

Order deny,allow
Deny from all
Allow from 10.176

Make sure your file is .htaccess and not .htaccess.txt.

Regards,

toivo
Sydney, Australia

Options: ReplyQuote


Sorry, only registered users may post in this forum.