【问题标题】:Website fails to load, but on refresh loads?网站无法加载,但刷新加载?
【发布时间】:2013-08-13 15:02:03
【问题描述】:

所以我的域指向一个重定向文件,该文件又会加载网站的第一页。

它过去一直有效。不过,主机最近切换了服务器,并表示它将是无缝的。现在,当您导航到 www.AiySlumlords.com 时,它会命中重定向,然后无法加载第二页。但是,如果您在刷新失败后点击刷新,那么它会加载吗?

我不知道为什么这不起作用。这是重定向文件

<html>
<head>
<title>A web page that points a browser to a different page after 2 seconds</title>
<meta http-equiv="refresh" content="0; URL=./Home/f1.html">
<meta name="keywords" content="automatic redirection">
</head>
<body>
<p>If your browser doesn't automatically go there within a few seconds, you may want to go to <a href="./Home/f1.html">the destination</a> manually.</p>
</body>
</html>

【问题讨论】:

    标签: html iis redirect


    【解决方案1】:

    由于您的服务器由 IIS 和 ASP.NET 提供支持,因此最好使用 ASP.NET 来重定向您的客户端,例如创建一个 index.aspx 页面,内容如下:

    <%
      Response.Redirect("~/Home/f1.html", false);
      Response.StatusCode = (int)System.Net.HttpStatusCode.MovedPermanently;
      Response.End();
    %>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-15
      • 2022-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-24
      相关资源
      最近更新 更多