用ASP来做301永久重定向

Posted on October 06, 2008 by Fdream

BLOG换程序了,简单地把以前的一些链接做了一个重定向(Redirect),用的是Response.Redirect,在ASP中,这种方式是302跳转:

302重定向是临时性转移,301是永久转移,很多网站都不太注意这两个跳转的区别,而搜索引擎在对302和301跳转时会进行区别对待。使用301跳转后,搜索引擎会把旧地址下原有的外部链接和数据转移到新的地址下面,而302重定向则不会如此。

在ASP中可以使用如下方法来进行301重定向:

Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", NewUrl
Response.End()

可以看到301的结果如下:

分享 |
Categories:
Ajax Web
Tags:
Comments:
Leave a comment
Views:
843 Views

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>