简体   繁体   中英

Disable directory browsing apache isn't working

I want to disable directory browsing in WordPress. But it's not working. Please help me. I've already edit htaccess (Options -Indexes)

This is folder 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>

There is some inconsistency in your config file. I'm thinking that

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

Should actually be

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

Notice the missing " quotes and /

Also

AllowOverride all

should be

AllowOverride All

Notice the capital A on All

If that doesn't fix your problem let me know what version of Apache and is this Windows or Linux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM