2014-01-07 43 views
0

我已將Wordpress安裝在根文件夾和landing.html文件中,我想成爲我的博客的首頁。我的.htaccess文件:在wordpress中使用.htaccess服務靜態html頁面

# 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重定向到它。

+0

是的,我嘗試了標準的WordPress的方法,但模板的CSS不斷破壞我的網頁和腳本和圖像的鏈接被破壞。 – Juribiyan

回答

0

除了DirectoryIndex試試這個規則略低於RewriteBase

DirectoryIndex landing.html index.php 

RewriteRule ^$ /landing.html [L] 

最有可能的,你可以通過你的WP主題做到這一點也。

也許你的WP永久鏈接設置也需要相應地改變。

+0

仍index.php重定向到landing.html – Juribiyan

+0

嗯看到更新的答案。如果它不起作用,我會嘗試與我的本地主機上的WP一起玩。 – anubhava