Click to See Complete Forum and Search --> : <Directory> in .htaccess


Znupi
04-19-2007, 06:10 PM
I'm using Apache 2.2 and trying to deny access to a folder using the <Directory> directive in a .htaccess file. I'm using:

<Directory "K:/htdocs/site/download">
Order Deny,Allow
Deny from All
</Directory>

The problem is, it doesn't work from the .htaccess file (which is placed in the "K:/htdocs/site" directory), the server gives a 500 error, but it works if I put it in the httpd.conf file. Why?

Jeff Mott
04-19-2007, 06:22 PM
An .htaccess file is already assumed to be modifying the directory in which the file resides. So you just need to cut out the directory tags.

Znupi
04-19-2007, 06:32 PM
Oooooh you're right... I'm tired :o... just put a .htaccess in the download directory with

Order Deny,Allow
Deny from All

and it works... thanks!