首页 > Web开发 > 详细

Apache站点默认首页设置

时间:2015-10-19 01:54:18      阅读:694      评论:0      收藏:0      [点我收藏+]

Apache的默认首页为index.html,当我们需要改首页文件或者增加首页文件时,可以在httpd.conf文件中增加配置语句。

httpd.conf首页文件默认配置语句如下:

<IfModule dir_module>

    DirectoryIndex index.html

</IfModule>


如果我们需要增加首页文件xxx.htm时,可以在DirectoryIndex index.html下增加加一行语句DirectoryIndex xxx.htm,优先级从上到下。

例如我需要增加index.htm、defaul.htm、index.php文件,配置语句需改为:

<IfModule dir_module>

    DirectoryIndex index.html

   DirectoryIndex index.htm

   DirectoryIndex default.htm

   DirectoryIndex index.php

</IfModule>


改好后保存,需重启Apache后才能生效。

Apache站点默认首页设置

原文:http://guotou.blog.51cto.com/3337127/1704076

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!