2010年5月12日把5u转向返回改成301代码
5U有个文件,redirect.asp 是用来根据ID跳转的.基本没什么大用处,但发现返回的是302状态这样应该对SEO不是很好. 因为302是临时链接,不是永久链接,301才是永久链接于是更换redirect.asp的代码,让他返回301.
- <!--#include file="../inc/const.asp"-->
- <%
- dim url: url = request.querystring : url=replace(url,"'","")
- if Len(url) > 0 and instr(url,",") = 0 and isnumeric(url) then
- dim rs
- Set rs = db("Select Top 1 [id],[Cid],[Diyname],[Createtime],[Viewpath] From [{pre}Content] Where [Display]=1 and [id]=" & url ,1)
- if rs.Eof then
- url = "index.asp"
- else
- url = buildviewpath(rs("id"),rs("Cid"),rs("Diyname"),rs("Createtime"),rs("Viewpath"))
- end if
- if right(url,3) = "///" then url = left(url,len(url)-3)
- rs.Close: Set rs = Nothing
- conn.close: set conn = nothing
- end if
- if Len(url) = 0 then url = "index.asp"
- Response.Status="301 Moved Permanently"
- Response.AddHeader "Location", url
- %>
希望以上的代码对大家有所帮助.
你浏览的文章是 - 《把5u转向返回改成301代码》! 文章出处:http://www.zheteng.net.cn/news/183.html 折腾专业针对河北seo提供网站优化服务。并对企业seo有着独到的眼光。详情咨询客服QQ:8972812。
