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.
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.