示例http://www.mysite.com/contact.aspx?page=contact
http://www.mysite.com/contact.php我应该使用301还是htaccess?我已经看了两个例子,但我仍然很困惑。
谢谢!
301是最好的永久重定向。如何实现301取决于您的服务器。如果你正在使用Apache,你可以使用mod_redirect:
rewriteEngine on
rewriteRule ^contact.aspx$ http://www.mysite.com/contact.php [R=permanent,L]
您也可以在Apache httpd.conf中配置重定向(这是我通常做的方式)