banner
ximalaya

ximalaya

这里是openkava 的blog,关注程序开发的一切技术。 ZZ 表示转载的文章,如涉及版权,请和我联系删除。 在这里你可以看到关于以下技术的文章: 移动开发技术,ANDROID ,IOS,WINDOWS PHONE平台开发,企业ERP开发,动态脚本PYTHON ,OPENGL ES 3D技术,游戏开发技术,HTML5 ,JAVASCRIPT ,MYSQL,AMAZON EC2 ,GOOGLE GAE ,GOOGLE CLOUD SQL 等 。 本站发展历程: 2010年,正式把所有的blog移到这里,租用godaddy的空间,记录生活和工作上的一些心得。 下面是关于我的个人介绍,写在这里权当凑字数啦。 职业:软件开发,开发经验6年,管理经验3年; 工作上使用的技术:C#, SQL SERVER 个人使用的技术:PYTHON,PHP, CSS, JAVA ,ANDROID ,object-c 等等 联系我请发邮件:<a href="http://blog.openkava.com/openkava@gmail.png"><img class="alignnone size-full wp-image-96" title="邮箱" src="http://blog.openkava.com/openkava@gmail.png" alt="" width="174" height="24" /></a>

How to disable Apache directory listing

How to Disable Apache Directory Listing (403 Forbidden Access Issue Caused by .htaccess File)

How to disable Apache from displaying directory listing?
By default, if you enter the following address in your browser:
http://localhost:8080/
and you have set your directory index file to index.html, and you have an index.html file in your file root directory,
the browser will display the content of index.html. If there is no index.html, the browser will display the directory listing of the file root directory,
which includes files and subdirectories under the file root directory.
(Note: Setting the index file:)

#Here, you can set the file that will be executed first when a directory is requested
DirectoryIndex echo.php index.html index.php

Similarly, if you enter the address of a virtual directory:
http://localhost:8080/b/
If there is no index.html in that virtual directory, the browser will also display the directory structure of that virtual directory, listing the files and subdirectories under that virtual directory.

How to disable Apache from displaying directory listing?

In the httpd.conf file, find a directive similar to this:
<Directory "D:/xx/xx/xx">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

Modify the directive as follows:
Method 1: Add a "-" symbol in front of "Indexes" in "Options Indexes FollowSymLinks".
That is: Options -Indexes FollowSymLinks

Method 2: Change "Options Indexes FollowSymLinks" to "Options FollowSymLinks".

Method 3: Add a .htaccess file in the directory and write the directive: Options FollowSymLinks

The purpose of "Indexes" is to display the directory structure when there is no index.html file in that directory. Removing "Indexes" will prevent Apache from displaying the directory listing of that directory.
Note: Adding "+" before "Indexes" allows directory browsing; adding "-" prohibits directory browsing.

The above information is excerpted from: http://blog.chemdown.cn/server/prohibit-display-apache-directory-listing-indexes-followsymlinks.html

403 Forbidden Access Issue Caused by .htaccess File

Those who have used WORDPRESS may have encountered this problem,
such as zaphod22 who encountered it at http://wordpress.org/support/topic/htaccess-leads-to-403-forbidden?replies=6
In fact, this problem is also caused by improper setting of "Options Indexes FollowSymLinks". Of course, if you don't want to change the .ini file,
you can add the directive "Options +FollowSymLinks" in the .htaccess file.

Special note: For the directives in the .htaccess file to take effect, the "AllowOverride All" of the directory must be enabled.
Another note: Official documentation for setting redirects in .htaccess: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.