码迷,mamicode.com
首页 > Web开发 > 详细

Apache站点默认首页设置

时间:2015-10-19 01:55:00      阅读:256      评论:0      收藏:0      [点我收藏+]

标签:apache 首页默认文件

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站点默认首页设置

标签:apache 首页默认文件

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!