apache如下:
配置 文件位置:apache\conf\httpd.conf
DocumentRoot "D:\WWW"
<Directory />
<FilesMatch "file.txt"> 或 <FilesMatch "\.(?i:txt)$"> 多个txt文件
Order Allow,Deny
Deny from all
</FilesMatch>
</Directory>
参考
http://blog.csdn.net/toney520/article/details/25962675