对于有时我们网站出现多个不规范的网址,会给搜索引擎收录和排名带来很多的麻烦,那么,最有效的一种解决方法就是使用301转向,把不规范的链接引到规范化的网址下。这就引出了现在我们要讨论的话题:怎么做301永久性重定向呢?
先创建一个.htaccess文件
RewriteEngine on

Redirect permanent /index.php http://www.idaus.com/index.php?go=category_6(将网页index.php重定向到http://www.idaus.com/index.php?go=category_6)
Header( "HTTP/1.1 301 Moved Permanently" ) ;
Header( "Location: http://www.xxx.com" );
?>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.xxx.com"
%>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader ("Location","http://www.xxx.com");
}
</script>