2015-06-30 58 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。 –