【问题标题】:Disable directory browsing apache isn't working禁用目录浏览 apache 不起作用
【发布时间】:2017-06-04 04:47:33
【问题描述】:

我想在 WordPress 中禁用目录浏览。但它不起作用。 请帮我。我已经编辑了 htaccess (Options -Indexes)

这是文件夹 httpd

   <Directory "${INSTALL_DIR}/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.4/mod/core.html#options
    # for more information.
    #
    Options +Indexes +FollowSymLinks +Multiviews


    #
    # 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 all

    #
    # Controls who can get stuff from this server.
    #

   #   onlineoffline tag - don't remove
    Require all granted


   </Directory>
  <Directory ${INSTALL_DIR}/www/wp-includes>
  Options -Indexes
  AllowOverride None
  Order allow,deny
  </Directory>

【问题讨论】:

  • 你重启你的httpd了吗?
  • 如果我重新启动 apache?答案是肯定的,我重启服务器apache。

标签: apache


【解决方案1】:

您的配置文件中存在一些不一致之处。我是这么想的

<Directory ${INSTALL_DIR}/www/wp-includes>

应该是

<Directory "${INSTALL_DIR}/www/wp-includes/">

请注意缺少的 " 引号和 /

还有

AllowOverride all

应该是

AllowOverride All

注意所有的大写A

如果这不能解决您的问题,请告诉我 Apache 的版本,这是 Windows 还是 Linux。

【讨论】:

    猜你喜欢
    • 2017-06-29
    • 2020-01-29
    • 2012-06-14
    • 2011-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多