htaccess Redirect&重写条件

时间:2016-03-24 16:05:15

标签: .htaccess

我试图让我的网站将几页重定向到一个新的错误页面'我创造了。我能不能看看所有人?已经创建的.htaccess文件已经为我完成了,因此我将远离www。并且仅与example.com一起使用。所以,看看并告诉我它是什么?请:)

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.example\.com$

RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]

RedirectPermanent 301 /oldpage.html http://www.example.com/missing-page.html

RedirectPermanent 301 /oldpage.html http://www.example.com/missing-page.html

RedirectPermanent 301 /oldpage.html http://www.example.com/missing-page.html

RedirectPermanent 301 /oldpage.html http://www.example.com/missing-page.html

RedirectPermanent 301 /oldpage.html http://www.example.com/newpage.html

1 个答案:

答案 0 :(得分:0)

'RedirectPermanent 301 ...'无效。 RedirectPermanent确定重定向是301重定向,因此您不会传递状态代码。只需使用'RedirectPermanent / old ...'。