禁用目录浏览apache不起作用

时间:2017-01-19 13:09:12

标签: apache

我想在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>

1 个答案:

答案 0 :(得分:0)

配置文件中存在一些不一致之处。我在想

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

实际应该是

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

请注意缺少引号和 /

另外

AllowOverride all

应该是

AllowOverride All

注意所有

上的资本 A

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