Prohibit Apache display directory index, prohibit Apache display directory structure list, prohibit Apache Browse directory, this is more online questioning, in fact, is a meaning. Here's a list of 3 common ways to prevent Apache from displaying directory indexes.
To prevent Apache from displaying directory indexes, simply remove the Indexes from Option.
1) Modify the directory configuration:
Copy Code code as follows:
<directory "D:/apache/blog.phpha.com" >
Options Indexes FollowSymLinks # Modified to: Options FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
You can prevent Apache from displaying the directory structure simply by removing the Indexes from the above code. Users will not see the list of files and subdirectories in the directory. Indexes is the role of the directory when there is no index.html file, the directory structure, remove the Indexes, Apache will not display the list of the directory.
2) Modify the Apache configuration file [httpd.conf]
Search "Options Indexes followsymlinks", modified to "options-indexes followsymlinks" can be.
In the options Indexes followsymlinks the front of the Indexes plus-symbol. Note: Before indexes, plus + represents permission for directory browsing, plus-represents a ban on directory browsing. This would be the whole Apache block directory browsing.
If you are configuring a virtual machine, the following are:
Copy Code code as follows:
<virtualhost *>
<directory ". /vhosts/blog.phpha.com ">
Options-indexes FollowSymLinks # modified to-indexes
</Directory>
ServerAdmin mail@jb51.com
DocumentRoot ". /vhosts/blog.phpha.com "
ServerName shopex:80
Serveralias blog.phpha.com
ErrorLog Logs/blog.phpha.com-error_log
</VirtualHost>
3) Adoption of the. htaccess file
You can add a new or modified. htaccess file in the root directory
Copy Code code as follows:
<files *>
Options-indexes
</Files>
You can prevent Apache from displaying directory indexes.