Apache Options Indexes FollowSymLinks详解

第一种方法

<Directory "E:\myvirtualhost\localhost">
   Options Indexes FollowSymLinks   #Options FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

  去掉Indexes (Indexes 的作用就是当该目录下没有 index.html 文件时,就显示目录结构,去掉 Indexes,Apache 就不会显示该目录的列表了。)

第二种方法
        1、编辑httpd.conf文件

  找到如下内容:

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前,加 + 代表允许目录浏览;加 – 代表禁止目录浏览。】

 第三种方法

  可以在根目录的 .htaccess 文件中输入

  <Files *>
    Options -Indexes
  </Files>
  就可以阻止Apache 将目录结构列表出来。

最新文章

  1. ASP.NET之纠错
  2. 制作简单的2D物理引擎(一)&mdash;&mdash;动力学基础
  3. 实例--post请求,完成一个抽奖程序概率的测试
  4. [AC自动机]HDOJ3695 Computer Virus on Planet Pandora
  5. 『重构--改善既有代码的设计』读书笔记----Hide Delegate
  6. Perl时间处理函数
  7. 第一个androidAPP项目总结—数据请求
  8. Https协议简析及中间人攻击原理
  9. SSH WebShell: SSH在线WEB管理器安装教程 - VPS管理百科
  10. Effective C++规定45 附加代码
  11. Crystal框架配置参数加载机制详解?
  12. 模拟退火算法实例(c++ 与 c# 实现)
  13. 18.18 Datasheet Note
  14. Ubuntu 12.04 LTS 查看网关地址方法汇总
  15. Oracle会话超时退出设置
  16. 为tomcat8安装Native library
  17. nw.js---开发一个百度浏览器
  18. 多线程Thread
  19. Linux常用基本命令:三剑客命令之-awk模式用法(2)
  20. 【POJ3061】Subsequence

热门文章

  1. 洛谷$P$2286 宠物收养场 $[HNOI2004]$ $splay$
  2. Windows远程桌面管理--功能强大的远程批量管理工具【转】
  3. 浅谈Java三大特性之封装
  4. 6.7 Mapreduce作业流JobControl和Oozie
  5. Java手写数组栈
  6. InnoDB与MyISAM的区别(高性能MySQL笔记)
  7. SpringBoot系列之集成Dubbo的方式
  8. 在IIS上发布netcore项目
  9. JPQ整合Querydsl入门篇
  10. Java小白集合源码的学习系列:Vector