独立服务器
虚拟主机
- <li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;"><%
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">dim s,t:s=Replace(Replace(request.querystring,"404;",""),":80/","/"):t=s
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">s=replace(s,"老域名","新域名")
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">'response.write s
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">if t<>s then
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">Response.Status="301 Moved Permanently"
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">Response.AddHeader "Location",s
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">else
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">Response.Status="404 Not found"
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">end if
- </p></li><li style="margin-right: auto; margin-left: auto;"><p style="margin-top: 2pt;">%></p></li>
复制代码
复制代码
放在站点根目录
注意:
s=replace(s,"老域名","新域名")
老域名、新域名都不要包含http:
|