How to route EVERYTHING other than Web API to /index.html

后端 未结 6 483
春和景丽
春和景丽 2020-12-04 12:49

I\'ve been working on an AngularJS project, inside of ASP.NET MVC using Web API. It works great except when you try to go directly to an angular routed URL

6条回答
  •  不思量自难忘°
    2020-12-04 13:37

    Use a wildcard segment:

    routes.MapRoute(
        name: "Default",
        url: "{*anything}",
        defaults: new { controller = "Home", action = "Index" }
    );
    

提交回复
热议问题