Page 1 of 1

.htaccess file protection not working

Posted: Wed Jan 24, 2007 12:45 pm
by kaisellgren
Hi,

I use

Code: Select all

<FilesMatch "\.txt">
Order allow,deny
Deny from all
</FilesMatch>
To block visitors access to all .txt files in the directory where the .htaccess is placed. However, this obviously does not work. It blocks visitors from seeing the file in the directory listing, but if I type full path to any txt file I will see the contents of that file easily.

How do I block access to all .txt files ENTIRELY?

Thank you for your help!

Posted: Wed Jan 24, 2007 1:49 pm
by nickvd
change the order of your order directive to deny,allow

or

add Allow from none above your deny from all..

the order directive is "order" specific... so, if you put "Order deny,allow" apache is expecting deny from <whomever> to come first... conversely if you put "Order allow,deny", it would expect Allow from <adfasdf> first...

Posted: Wed Jan 24, 2007 2:48 pm
by kaisellgren
Tried without luck.

Code: Select all

<FilesMatch "\.txt$">
Order allow,deny
Allow from none
Deny from all
</FilesMatch>