My angular 2 app runs fine on my local node server. However when the dist/prod contents are deployed to a server (to be precise websphere liberty server) The url just works fine for once. When I try to reload it, it gives me File not found exception. Also the deep routes for e.g http://localhost:5555/myapp/route1/somefeature/extra doesn't work and throws the same exception.
Just to confirm:
- I am using proper basehref (for e.g '/myproduct/')
- The server.xml contains proper contextpath ('/myproduct/')
- Thus the url http://someserver:8080/myproduct/myapp runs fine but when refreshed or deep routes are hit, it throws file not found exception
I have gone through this post Angular2 routing / deep linking not working with Apache 404 and need the similar kind of settings in my server.xml (for liberty websphere server)
Since I do not want to go back to include old implementation of hash(#) urls, Any help in this regard is much appreciated.