曾军的博客
记录我互联网产品的全新旅程
当前位置: 主页 > 代码收藏 >
22
2006-04
301转向的代码
作者:admin | 浏览:

站长都知道是干什么的了 ...

ASP:

  1. Response.Status="301 Moved Permanently"   
  2. Response.AddHeader "Location", "http://www.teched.cn/"   
  3. Response.End 

PHP:

  1. header("HTTP/1.1 301 Moved Permanently");   
  2. header("Location:http://www.teched.cn/);   
  3. exit(); 

ASP.NET:

  1. <script runat="server">   
  2. private void Page_Load(object sender, System.EventArgs e)   
  3. {   
  4. Response.Status = "301 Moved Permanently";   
  5. Response.AddHeader("Location","http://www.teched.cn/);   
  6. }   
  7. </script> 
Tags:代码 301 转向 
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片