Common ways to prevent Apache from displaying directory indexes (Apache forbidden list)

Source: Internet
Author: User

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:

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.

" d:/apache/blog.phpha.com ">  from all </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:

<virtualhost *>    <directory".. /vhosts/blog.phpha.com">Options-indexes FollowSymLinks # Modified to-Indexes can</Directory>ServerAdmin [email protected] documentroot".. /vhosts/blog.phpha.com"ServerName Shopex: theserveralias 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

<files *>-Indexes</Files>

You can disable Apache from displaying directory indexes.

Common ways to prevent Apache from displaying directory indexes (Apache forbidden list)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.