PDA

View Full Version : .htaccess deny access to all but one file



Beverleyh
01-04-2011, 05:46 PM
I have an .htaccess file in a subfolder of my site.

Currently its contents are set to "deny from all" but I want to access one known .txt file directly from that subfolder while continuing to block the rest.

Please could somebody advise how to just allow access to this one file?

Also, can the path to this one file in the .htaccess file be relative?

Thanks in advance.

Beverleyh
01-04-2011, 08:50 PM
Never mind - I sussed it;


Order Deny,Allow
Deny from All

<Files "view_only_this_file.txt">
Order Deny,Allow
Allow from All
</Files>