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

编程知识 行业动态 更新时间:2024-06-13 00:22:42

转自:http://blog.sina/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

更多推荐

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

本文发布于:2023-04-03 02:19:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/2739e709472660ef522c5a67541a8c06.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:首页   顺序   Apache   index   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!