1
嗨我写一个Codeigniter应用程序,我创建一些目录,因为我上传文件。htaccess限制访问文件夹和子文件夹
如何在我的.htaccss文件中添加一条规则,该规则禁止直接访问我的上传文件夹及其子文件夹,同时允许访问这些文件夹中的文件?
我的文件结构如下
index.html
.htaccess
uploads/ <- No direct access allowed
uploads/gallery/ <- No direct access allowed
uploads/gallery/1 <- No direct access allowed
uploads/gallery/1/file1.jpg <- access is ok
uploads/gallery/1/file2.jpg <- access is ok
uploads/gallery/2 <- No direct access allowed
uploads/gallery/2/file3.jpg <- access is ok
uploads/gallery/2/file4.jpg <- access is ok
谢谢:)得上的.htaccess规则 – Oldenborg 2015-04-01 07:55:04
读了http://askapache.com是相当不错的资源 – anubhava 2015-04-01 08:03:08