2017-03-07 160 views
0

我有舊的html網站有.html頁面,我想重定向到WordPress的非HTML頁面。重定向.html到非html頁面wordpress

例如。

舊網站 http://myweb212.com/About-Us/jony-test.html

WordPress站點。

http://myweb212.com/About-Us/jony-test

有在網站多個頁面所以這可能與一個規則做到這一點?

我試圖用一個規則,但它打破了某些文件夾上傳的圖片,並顯示404

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
RewriteRule . /index.php [L] 
</IfModule> 

回答

0

插入另一個規則(RewriteRule)及其相關條件(RewriteCond)之間的新規則打破這個其他規則。

所以,當你移動規則開頭或結尾,它應該工作原樣。

一個小挑逗,從來沒有R=301測試!當一切正常時,您可以用R=301permanent redirect)代替R

相關問題