[英]htaccess Redirect & Rewrite Conditions
我正在尝试让我的网站将几页重定向到我创建的新“错误页面”。 我可以让你们看看吗? 已经为我创建了一个已经创建的.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
“ RedirectPermanent 301…”无效。 RedirectPermanent确定重定向为301重定向,因此您不传递状态码。 只需使用'RedirectPermanent / old ...'。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.