precedence,HTML和PHP索引文件 [英] Precedence, HTML and PHP Index File

查看:101
本文介绍了precedence,HTML和PHP索引文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把一个index.html文件,并在我的网站的根目录中的index.php文件一起,当我浏览到我的网站,www.site.com,它服务的PHP文件而不是HTML文件,我问题是为什么?为什么它为超过HTML的PHP​​? Apache服务器。

I put an index.html file and an index.php file in the root directory of my site together, when I navigate to my site, www.site.com, it serves the php file instead of the html file, my question is why? Why does it serve the php over html? Apache server.

推荐答案

检查阿帕奇的DirectoryIndex指令。

Check the DirectoryIndex directive of Apache.

<一个href=\"http://httpd.apache.org/docs/2.0/mod/mod_dir.html\">http://httpd.apache.org/docs/2.0/mod/mod_dir.html

例如

DirectoryIndex index.html index.php

将尝试率先发球的HTML,如果它不存在,它将服务于PHP。

Will try to serve first the html, if it doesn't exist it will serve the php.

这篇关于precedence,HTML和PHP索引文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆