Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
index.php或index.html之间的服务器页面优先级_Php_Wordpress_.htaccess - Fatal编程技术网

index.php或index.html之间的服务器页面优先级

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

有人能告诉我,如果我们有,哪个文件将首先被加载 1.index.php 2.index.html

服务器上的文件

我想在同一个域上安装wordpress站点,同时,我想加载我的index.html页面作为保留页面,直到我正确启动网站。我该怎么做呢?

如果您使用Apache(我假设您是这样做的,因为您用
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页面