2015-06-30 59 views

回答

0

你應該使用重寫,因爲你已經使用mod_rewrite,它應該在你的其他規則之前。如果你重定向到一個新的域名,其他規則可能不需要在那裏。

RewriteEngine On 
RewriteBase/
#redirect to new domain 
RewriteRule ^(.*)$ https://www.newdomain.com/$1 [R=301,L] 

#other rules you probably do not need anymore 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME}/index.html !-f 
RewriteCond %{REQUEST_FILENAME}/index.php !-f 
RewriteRule . index.php [L] 
+0

對不起。我認爲我原來的解釋不夠好。只有幾頁重定向到新網站而不是整個舊網站。我會嘗試你的解決方案,只需要爲每個頁面添加一個rewriterule。 –