Angular2 removed hash from URL on Tomcat

Viewed 524

We have Angular 2 app, we removed HashLocationStrategy from providers for routing without hash ('#').

It works fine when we run project using ng server.

However when we generate build and deployed build on apache-tomcat-7.0.67 and URL with route [(e.g) localhost:8080/dist/login] here login is route, then when we refresh it returns with 404 page.

I tried solution suggested in this link : Apache Tomcat Rewrite Rules

But still I cant find any working solution for my case as of this is angular2 application.

Please guide for better solution without using any external url-rewrite library like nginx etc.

Thank you.

0 Answers
Related