使用.htaccess在wordpress中提供静态html页面

时间:2014-01-07 12:25:49

标签: wordpress .htaccess

我将Wordpress安装在根文件夹和landing.html文件中,我想成为我博客的首页。我的.htaccess文件:

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

# END WordPress

当我在DirectoryIndex landing.htmlRewriteBase /作为首页添加landing.html后,index.php也会重定向到它。

1 个答案:

答案 0 :(得分:0)

除了DirectoryIndex之外,请在RewriteBase行下方尝试此规则

DirectoryIndex landing.html index.php

RewriteRule ^$ /landing.html [L]

你最有可能也可以通过你的WP主题来做到这一点。

您的WP永久链接设置也可能需要相应更改。