今天突然想起了要把网站文件列表显示功能禁止了,google,baidu了一下发现只要对Options Indexes FollowSymLinks和Options None就可以,现在我们来看看兄弟两之间的事情,
在apache安装目录下找到httpd.conf文件,用记事本打开,通过查找功能找到
代码如下 |
|
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
|
这一段,将Options Indexes FollowSymLinks修改为Options None
把下面的Options Indexes FollowSymLinks改为Options FollowSymLinks就不会浏览目录了,加上就又可以浏览目录了
代码如下 |
|
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory> |
在httpd.conf中有两个这样的段落都要这样子修改,完成后保存,重启apache即可
如果你不是服务器肯定没有修改httpd.conf的权限,那么我们只要按下面操作这样,最简单的办法就是在要禁止文件列表的目录下建立.htaccess文件,然后在里面加入一行:
Options All -Indexes就可以了。
注意:我自己在按面方法时出现个小问题,就是按(<Directory />)它的目录设置是无效的
后来发现我应该是在我的
代码如下 |
|
<Directory "E:www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
Options none
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
|
这样就完全实现了禁止目录显示列表了
热门标签:
dede模板 /
destoon模板 /
dedecms模版 /
织梦模板
责任编辑: