301 重定向单个文件更新 URL

301 Redirect Single File Update URL

如何更新位置 Header 以重定向到另一个 URL?

页面代码:

<%@ Language=VBScript %>
<%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.example.com/new-url.asp"
%>

现在我在浏览器中访问页面并被重定向到 www.example.com/new-url.asp

我现在需要将 URL 更改为 www.example.com/new-url-updated.asp

新页面代码:

<%@ Language=VBScript %>
<%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.example.com/new-url-updated.asp"
%>

现在我访问该页面,它仍然将我重定向到 www.example.com/new-url.asp 而不是 www.example.com/new-url-updated.asp

网站是 运行 IIS,Windows Server 2003。

防止页面被缓存(参见Response.CacheControl):

Response.CacheControl = "no-cache"

Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.example.com/new-url-updated.asp"