我在 godaddy.com 上部署了一个带有 razor 视图的 MVC Web 应用程序。我的应用程序在 localhost 上运行良好,但部署后,当我输入域名时,它无法路由到我的主页。我在 Global.axcs 文件中注册了以下路线。
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "HomePage", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
Godaddy 的技术支持要求我在根目录中添加一个 index.html 文件。我确实添加了一个并评论了 Global 中的默认路由。它会加载 index.html。但我真的很想显示我的 /HomePage/Index
有谁知道为什么会这样,有什么建议吗?