使用 htaccess 拒绝目录列表 [英] deny directory listing with htaccess

查看:28
本文介绍了使用 htaccess 拒绝目录列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件夹,例如:/public_html/Davood/文件夹中的子文件夹太多,例如: /public_html/Davood/Test1//public_html/Davood/Test1/Test//public_html/Davood/Test2/ , ...

I have a folder, for example : /public_html/Davood/ and too many sub folder in folder, for example : /public_html/Davood/Test1/ , /public_html/Davood/Test1/Test/ , /public_html/Davood/Test2/ , ...

我想在 /public_html/Davood/ 中添加一个 htaccess 文件来拒绝 /Davood 中的 DirectoryListing 和子文件夹,这是可能的吗?

I want add a htaccess file into /public_html/Davood/ To deny DirectoryListing In /Davood And Sub Folders, It's Possible ?

推荐答案

Options -Indexes 应该可以防止目录列表.

Options -Indexes should work to prevent directory listings.

如果您使用的是 .htaccess 文件,请确保您的主要 apache 配置文件.

If you are using a .htaccess file make sure you have at least the "allowoverride options" setting in your main apache config file.

这篇关于使用 htaccess 拒绝目录列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆