Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Common methods of preventing apache from displaying Catalog Index

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "common methods to prohibit apache from displaying directory indexes". In daily operation, I believe many people have doubts about common methods to prohibit apache from displaying directory indexes. Xiaobian consulted all kinds of information and sorted out simple and easy to use operation methods. I hope to answer your doubts about "common methods to prohibit apache from displaying directory indexes". Next, please follow the small series to learn together!

To disable Apache from displaying directory indexes, simply remove Indexes http://www.bbqmw.net/qm_yeqm/from Option.

1)Modify directory configuration:

The copy code is as follows:

Options Indexes FollowSymLinks #modified to: Options FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

Simply remove the Indexes from the above code to disable Apache from displaying the directory structure. Users will not see the list of files and subdirectories in that directory. Indexes is used to display the directory structure when there is no index.html file in the directory. Remove Indexes and Apache will not display the list of directories.

2)Modify Apache configuration file [httpd.conf]

Search for "Options Indexes FollowSymLinks" and modify it to "Options -Indexes FollowSymLinks".

In Options Indexes FollowSymLinks put a-sign in front of Indexes. Note: Before Indexes, add + to allow directory browsing; add-to prohibit directory browsing. In this case, it belongs to the entire Apache forbidden directory.

If you are configuring a virtual machine, it is as follows:

The copy code is as follows:

Options -Indexes FollowSymLinks #can be modified to-Indexes

ServerAdmin mail@jb51.com

DocumentRoot "../ vhosts/blog.phpha.com"

ServerName shopex:80

ServerAlias blog.phpha.com

ErrorLog logs/blog.phpha.com-error_log

3)via.htaccess file

can be added to the root directory in the new or modified.htaccess file

The copy code is as follows:

Options -Indexes

You can disable Apache from displaying the directory index.

At this point, the study of "common ways to prohibit apache from displaying directory indexes" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report