当我刷新我的网站时,我只在 IE11 和 Edge 的控制台中得到 404,Angular 5,Tomcat

When I refresh my website I get a 404 in console only in IE11 and Edge, Angular 5, Tomcat

当我在 IE11 或 Edge 浏览器中刷新我的 Angular 5 应用程序时,它在开发人员控制台中显示 404 错误响应

我的 angular 应用程序部署在 Tomcat 服务器中。我不想在路由器模块中使用 useHash: true

如何解决这个 404 响应错误?

基本上,您需要配置您的服务器以提供index.html。 参考这个。 https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode

遵循 angular 文档,在所有浏览器中工作正常。

Angular Server configuration