您的位置:首页 > 运维架构 > Apache

Apache:设置首页运行index.html index.php的顺序

2015-11-16 10:36 676 查看
转自:http://blog.sina.com.cn/s/blog_a345dd4c01011wug.html

编辑httpd.conf文件,找到DirectoryIndex在后面加一个index.php。

例如,我把DirectoryIndex这行改为:DirectoryIndex index.html index.htm index.php index.html.var

保存编辑的内容,重新启动Apache就可以实现了。

<Directory /xxx>

DirectoryIndex index.html index.htm index.php index.php3

</Directory>

如果上述设置后仍无法按顺序运行首页,那么还得修改一下php相关配置文件php.conf

/etc/httpd/conf.d/php.conf文件中的

DirectoryIndex index.php

上面是甚至index.php 优先,如果把DirectoryIndex index.php去掉,则index.html,应该也可以改成DirectoryIndex index.html 或者DirectoryIndex index.html index.php
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: