求助APACHE2.2.*如何禁止显示目录列表
解决时间 2021-04-01 00:32
- 提问者网友:未信
- 2021-03-30 23:37
RT,我用的XP系统,PHP5,APACHE,GD,MYSQL,
就是不能自动解析INDEX.PHP,每次一进没有INDEX.HTML的目录就要显示目录列表,我试过把INDEXES去掉,也没用,定义了文件夹还是没用.
现在的配置文件如下
ThreadsPerChild 250
MaxRequestsPerChild 0
ServerRoot "D:/server/DedeAMPZ/Program/Apache"
Listen 80
#省略点
LoadModule userdir_module modules/mod_userdir.so
#php5设置
#php5_start
phpIniDir "D:/server/DedeAMPZ/Program/php5"
LoadModule php5_module "D:/server/DedeAMPZ/Program/php5/php5apache2_2.dll"
#php5_end
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.html index.php index.htm
Order allow,deny
Deny from all
ErrorLog logs/error.log
LogLevel warn
DefaultType text/plain
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
#AddHandler cgi-script .cgi
#AddHandler type-map var
最佳答案
- 五星知识达人网友:平生事
- 2019-04-03 18:18
显示的是目录,而不是当前的文件内容,表示你的apache没有默认程序入口文件,也就是”index.php,home.php,index.html”等,也就是需要你在apache的配置文件httpd.conf里面找到:
DirectoryIndex index.html index.php index.htm
加入你希望程序一进来就执行的页面,以下是本人自己的配置文件,你可以参考一下:
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
DirectoryIndex index.php index.html index.htm
#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .html
#
全部回答
- 1楼网友:孤老序
- 2021-03-03 05:28
配置apache\conf\httpd.conf文件,在
...
DirectoryIndex index.html index.php index.htm
...
加入index.php文件
我要举报
大家都在看
推荐资讯