Prohibit Apache display directory index, prohibit Apache display directory structure list, prohibit Apache Browse directory, this is the online question more, in fact, is a meaning. The following is a list of common 3 ways to prohibit Apache from displaying directory indexes.
To implement a ban on Apache from displaying directory indexes, simply remove the Indexes in Option.
1) Modify the directory configuration:
The code is as follows:
<directory "D:/apache/blog.phpha.com" >
Options Indexes FollowSymLinks # Modified to: Options FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
Just remove the Indexes from the above code to prevent Apache from displaying the directory structure. The user will not see a list of files and subdirectories under that directory. The role of Indexes is that when there is no index.html file in the directory, the directory structure is displayed, and the Indexes is removed, and Apache does not display a list of that directory.
2) Modify Apache configuration file [httpd.conf]
Search for "Options Indexes followsymlinks" and Change to "Options-indexes followsymlinks".
In the options Indexes followsymlinks in front of the Indexes plus – symbol. Note: Before indexes, the Plus + delegate allows directory browsing; plus – disables directory browsing. This is the entire Apache Ban directory browsing.
If you are configuring a virtual machine, the following:
The code is as follows:
<virtualhost *>
<directory ". /vhosts/blog.phpha.com ">
Options-indexes FollowSymLinks # Change to-indexes
</Directory>
ServerAdmin [email protected]
DocumentRoot ". /vhosts/blog.phpha.com "
ServerName shopex:80
Serveralias blog.phpha.com
Errorlog Logs/blog.phpha.com-error_log
</VirtualHost>
3) through the. htaccess file
You can add new or modified. htaccess files in the root directory
The code is as follows:
<files *>
Options-indexes
</Files>
You can disable Apache from displaying directory indexes.
Common ways to prevent Apache from displaying directory indexes