ASP网站如何做301重定向

 时间:2024-11-08 20:04:27

1、先上一段我经常使用的asp代码:<%Dimdomain301,sndomain301=Request.ServerVari锾攒揉敫ables("Server_name")'获取域名'这里的3是指www的长度ifleft(domain301,3<>"www"thenResponse.Status="301MovedPermanently"    if(Request.ServerVariables("Query_String")<>"")thenResponse.AddHeader"Location","http://www.lichuangcheng.com"&Request.ServerVariables("Path_Info")&"?"&Request.ServerVariables("Query_String")elseResponse.AddHeader"Location","http://www.lichuangcheng.com"&Request.ServerVariables("Path_Info")endifResponse.Endend if%> 具体的思路就是,判断域名是不是有www,没有www的话跳转到一个添加了www的网址上。

  • ASP.NET网站如何配置301重定向
  • 怎么做301重定向?
  • 301重定向设置方法大全
  • 网站301重定向,网站301
  • 热门搜索
    猪耳朵的做法大全 万斯怎么辨别真假 dnf卡片怎么用 维c银翘片怎么样 手动挡起步正确方法 八宝饭的家常做法 家常豆腐 怎么进入路由器 锻炼方法 瘦肚子的最快方法运动