Apache查看并修改默认的索引页

在Apache web服务器中如何查看更改默认页面?

在Apache下使用DirectoryIndex指令来设置一个默认页面,默认设置为index.html。

编辑httpd.conf

打开Apache配置文件httpd.conf

# vi httpd.conf

找出以下行:

DirectoryIndex

根据要求进行设置:

DirectoryIndex index.html index.htm default.htm index.php index.pl

保存并关闭文件。重新启动Apache web服务器:

# /etc/init.d/httpd restart

请注意,如果我们没有访问Apache配置文件的权限。那么将目录索引添加到.htaccess文件中。

日期:2019-11-20 08:54:17 来源:oir作者:oir