Apache 更目录读取的默认优先级

如果更目录中含有 index.html 和 index.php 那么 Apache 是默认先读取 html 格式的文件的。

如下面的例子,在Apache 的 htdocs 目录中,我们有 index.html 和 index.php。

直接输入地址,我们会发现 Apache 先读取了 index.html

[attach]1253[/attach]

我们可以通过输入网站路径的方式,让 Apache 处理index.php

[attach]1254[/attach]

如果你希望 Apache 直接就能处理 index.php。

那么你需要删掉 index.html, 这个是最简单的办法。