You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ASP.Net WebForm应用发布后根路径访问报404,需默认跳转至/welcome.html的问题求助

ASP.Net WebForm应用发布后根路径访问报404,需默认跳转至/welcome.html的问题求助

各位好,我最近在发布ASP.Net WebForm应用时遇到了个棘手的问题,想请大家帮忙支招:

当我访问应用的根路径/时,会弹出404错误,具体错误信息如下:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /

我的需求是让访问根路径/时,能自动跳转到/welcome.html页面。目前直接访问url.com/welcome.html是完全正常的,没有任何问题。

我已经尝试了以下几种方法,但都没能解决问题:

  • 登录Azure门户,修改了应用的默认文档为Welcome.HTML
  • 在项目的Web设置里,指定了启动时导航到Welcome.HTML页面
  • 修改了RouteConfig.cs文件的路由配置,代码如下:
    routes.MapRoute(
        name: "Default",
        url: "",
        defaults: new { controller = "Home", action = "Index", id = "" }
    );
    

有没有大佬能给我一些其他的解决思路呀?万分感谢!

备注:内容来源于stack exchange,提问作者NiceBench

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 09:19:12