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
  • 热门搜索
    面临的近义词 发票打印机怎么安装 我的世界鱼竿怎么做 怎么洗葡萄 英雄联盟怎么投降 苹果一体机怎么样 黄桃罐头怎么做 瓜子脸发型 爱奇艺激活码怎么获得 酒后胃难受怎么办