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
相关产品推荐
相关产品推荐

