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
编辑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
相关文章推荐
- Centos6.7 编译安装 Apache PHP
- CentOS7安装Apache2.4+PHP5.6
- java.lang.NullPointerException at org.apache.jsp.index_jsp._jspInit
- 配置apache虚拟主机
- 用apachebench给服务器做并发压力性能测试
- 在CentOS6.7中编译安装 apache php mysql
- wordpress + apache 配置url rewirte
- Mac启用apache
- Apache 文件根目录设置修改方法 (Document Root)
- Apache 2.2.31-x86的安装
- ios程序员容易上手的服务器程序php入门【apache+php+mysql】开发环境搭建(一)
- Apache配置防盗链
- php 修改 AppServ 下Apache 端口
- 怎么卸载Apache_pn服务-PHPnow使用问题
- Android 5.0之后找不到apache类文件解决办法
- 在Ubuntu 14.04 LTS系统中设置Apache虚拟主机
- Apache Commons IO 示例
- WAMP(Windows Apache MySQL PHP)安装
- JAVA Apache-CommonsCollections 序列化漏洞分析以及漏洞高级利用
- 禁止JVM执行外部命令Runtime.exec -- 由Apache Commons Collections漏洞引发的思考