index.php或index.html之间的服务器页面优先级
有人能告诉我,如果我们有,哪个文件将首先被加载 1.index.php 2.index.html 服务器上的文件 我想在同一个域上安装wordpress站点,同时,我想加载我的index.html页面作为保留页面,直到我正确启动网站。我该怎么做呢?如果您使用Apache(我假设您是这样做的,因为您用index.php或index.html之间的服务器页面优先级,php,wordpress,.htaccess,Php,Wordpress,.htaccess,有人能告诉我,如果我们有,哪个文件将首先被加载 1.index.php 2.index.html 服务器上的文件 我想在同一个域上安装wordpress站点,同时,我想加载我的index.html页面作为保留页面,直到我正确启动网站。我该怎么做呢?如果您使用Apache(我假设您是这样做的,因为您用htaccess标记了它),您可以更改Apache配置/htaccess的DirectoryIndex属性,以包括索引文件的优先级顺序: DirectoryIndex index.html index
htaccess
标记了它),您可以更改Apache配置/htaccess的DirectoryIndex
属性,以包括索引文件的优先级顺序:
DirectoryIndex index.html index.htm index.php index.php4 index.php5
以下是“算法”:
- 当前文件夹中是否存在
?如果是,则加载,如果否,则继续:index.html
- 当前文件夹中是否存在
?如果是,则加载,如果否,则继续:index.htm
- 当前文件夹中是否存在
?如果是,则加载,如果否,则继续:index.php
- 当前文件夹中是否存在
?如果是,则加载,如果否,则继续:index.php4
- 当前文件夹中是否存在
?如果是,则加载,如果否,则继续:index.php5
- 发送
页面未找到错误404
这意味着您可以创建一个
index.html
文件,然后在希望站点正常运行后将其删除。请记住,如果任何人愿意,他们仍然可以访问index.php
——他们只需要指定它。Thant实际上取决于您的指令。将其设置为:
DirectoryIndex index.php index.html
如果可用,这将加载index.php
,如果不可用,则将尝试加载index.html
放入。htaccess:
DirectoryIndex index.html index.php
服务器将首先加载旧的html页面