I am using Angular 9.0 and everything is working fine in ng serve -o
mode but when i try to build the project using ng build
i can only view the root page. When i try to go to any other page it returns 404 error something i am not experiencing in local ng serve
mode. Any clues on how to fix the issue?
So http://www.example.com/ << this page opens fine but http://www.example.com/dashboard returns 404
Edit: In order to test difference scenarios, to see what might be causing the problem I have managed to identify the issue. Navigation works fine if I use routerLink, but it doesn't work if I use href or window.location.href. Any idea why it would crash when using href or window.location.href ?