的index.php或index.html的服务器页的优先级优先级、服务器、index、php

2023-09-02 01:06:58 作者:你过来,啪!

谁能告诉我哪些文件会被首先加载,如果我们有 1. index.php文件 2. index.html的

Can anybody tell me which file will be loaded first if we have 1. index.php 2. index.html

在服务器上的文件?

我想在同一个域中安装Word preSS网站,在同一时间,我想我的加载页面的index.html作为保持页面,直到我正确启动网站。我怎样才能做到这一点?

I want to install wordpress site on same domain, at the same time, I want to load my index.html page as a holding page until I properly launch website. How can I do this?

推荐答案

如果您使用Apache(我假设,因为你标记这与的htaccess 你这样做),你可以改变Apache配置/ htaccess的的的DirectoryIndex 属性包含索引文件的优先顺序:

If you use Apache (which I assume you do since you tagged this with htaccess) you can change your Apache config/htaccess's DirectoryIndex property to include the order of priority of index files:

DirectoryIndex index.html index.htm index.php index.php4 index.php5

这里的算法:

Here's the "algorithm":

在当前文件夹确实 index.html的存在吗?如果是的话,然后将其加载,如果没有,继续: 在当前文件夹确实的index.htm 存在吗?如果是的话,然后将其加载,如果没有,继续: 在当前文件夹确实的index.php 存在吗?如果是的话,然后将其加载,如果没有,继续: 在当前文件夹确实 index.php4 存在吗?如果是的话,然后将其加载,如果没有,继续: 在当前文件夹确实 index.php5 存在吗?如果是的话,然后将其加载,如果没有,继续: 发送一个未找到 404 页错误 Does index.html exist in the current folder? If yes, then load it, if no, continue: Does index.htm exist in the current folder? If yes, then load it, if no, continue: Does index.php exist in the current folder? If yes, then load it, if no, continue: Does index.php4 exist in the current folder? If yes, then load it, if no, continue: Does index.php5 exist in the current folder? If yes, then load it, if no, continue: Send a 404 page not found error

这意味着你可以创建一个 index.html的文件,然后删除它,一旦你想你的网站正常运行。请记住,任何人都仍然可以访问的index.php ,如果他们希望 - 他们只需要指定它

Which means you can create an index.html file and then delete it once you want your site to run normally. Keep in mind that anyone can still access index.php if they wish - they just need to specify it.