我目前正在回到一个旧的域名,并为SEO目的创buildredirect。 我没有做这么多,所以我一直在学习。
我试图:
到目前为止我有:
RedirectMatch 301 contactinfo.html http://www.newdomain.com/contact.php RedirectMatch 301 (.).html http://www.newdomain.com/index.php
我怎样才能禁止单个页面的redirect?
Redirect指令并没有真正的灵活性来做到这一点。 尝试使用mod_rewrite:
RewriteEngine on # Equivalent to your first RedirectMatch RewriteRule ^contactinfo\.html$ http://www.newdomain.com/contact.php [R=301,L] # Avoids taking any action on this page. RewriteRule ^filetonotredirect\.html$ - [L] # Equivalent to your second RedirectMatch RewriteRule ^.*\.html$ http://www.newdomain.com/index.php [R=301,L]