【问题标题】:How can I handle ASP request in an ASP.NET site?如何在 ASP.NET 站点中处理 ASP 请求?
【发布时间】:2010-11-08 08:45:38
【问题描述】:

我有一个托管在 ASP.NET 环境中的站点。该站点目前能够处理 .aspx 请求。如果用户请求服务器中不存在的 .aspx 页面,那么我可以将他/她重定向到通用错误页面。

现在的问题是,如果用户请求 .asp 页面, 例如,如果用户键入

http://www.example.com/index.asp

然后错误处理程序不起作用。我想把他/她重定向到这里,

http://www.example.com/index.aspx

我怎样才能做到这一点?

提前致谢。

【问题讨论】:

    标签: asp.net http iis asp-classic


    【解决方案1】:

    对于permanent redirect

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

    this

    Response.Redirect "http://www.new-url.com/"
    

    【讨论】:

    • 抱歉没有具体说明。我已经编辑了这个问题。你能再回答一下吗?
    猜你喜欢
    • 2021-08-21
    • 1970-01-01
    • 1970-01-01
    • 2011-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-30
    • 2010-09-10
    相关资源
    最近更新 更多