存档

文章标签 ‘html’

网站更换域名及实现ASP|PHP|JSP|HTML 301跳转

2009年6月14日 没有评论

1、用HTML
以下是代码片段:
<html>
<head>
<meta http-equiv=”Refresh” content=5;url=http://www.rainyheart.cn>
</head>
<body>
Loading…
</body>
</html>

    上面代码意思为:则会在5秒之后重定向到 http://www.rainyheart.cn;如果 http://www.rainyheart.cn为本身,则每5秒自动刷新1次;如果 content=0,则立即重定向。

    2、用asp

    以下是代码片段:

    <%@ Language=”VBScript” %>
    <%
    Response.Status = “301 Moved Permanently”
    Response.AddHeader “Location”, “http://www.rainyheart.cn
    %>

    或者在空间不支持.htaccess文件,可以通过以下事项

    在 index.asp 或 default.asp 的最顶部加入以下几行:

    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.rainyheart.cn/"
    Response.End
    %>
     阅读全文...
    分类: 电脑网络 标签: , , , , , ,