目录索引不正确

目录索引不正确

我试图加载默认的 DirectoryIndex home.html,但该网站不断跳转到 index.php。网站是基于 WordPress 构建的。

httpd.conf

DirectoryIndex index.html home.html index.php index.html.var

.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^home\.html$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

任何有关此事的帮助将不胜感激。

答案1

如果您坚持使用 HTML 启动页面,您可以执行以下操作:

  1. 将index.html重命名为default.html
  2. 将default.html上传到与index.php同一目录
  3. 将 default.html 添加到您的 DirectoryIndex 值。

FWIW,这个问题从 WordPress 2.7 开始就存在。看这个支持论坛帖子(最后一篇文章,第 2 页)

相关内容