apache 目录网站显示indexs
Apache?Options?Indexes?FollowSymLinks詳解
第一種方法
<Directory "E:\myvirtualhost\localhost">
?Options Indexes FollowSymLinks #Options FollowSymLinks
? AllowOverride None
? Order allow,deny
? Allow from all
</Directory>
去掉Indexes (Indexes 的作用就是當(dāng)該目錄下沒有 index.html 文件時(shí),就顯示目錄結(jié)構(gòu),去掉 Indexes,Apache 就不會顯示該目錄的列表了。)
?
第二種方法
????????1、編輯httpd.conf文件
找到如下內(nèi)容:
DocumentRoot "E:/laragonvirtualhost"
<Directory "E:/laragonvirtualhost">
#
# 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.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
? ??在Options Indexes FollowSymLinks Includes ExecCGI 在Indexes前面加上 – 符號。
? ? 即:?Options -Indexes FollowSymLinks Includes ExecCGI?【在Indexes前,加 + 代表允許目錄瀏覽;加 – 代表禁止目錄瀏覽?!?br />? ?
?第三種方法
可以在根目錄的 .htaccess 文件中輸入
<Files *>
Options -Indexes
</Files>
就可以阻止Apache 將目錄結(jié)構(gòu)列表出來。
轉(zhuǎn)載于:https://www.cnblogs.com/shynshyn/p/7893036.html
總結(jié)
以上是生活随笔為你收集整理的apache 目录网站显示indexs的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: react中用pace.js
- 下一篇: MPTCP协议学习