After the Aangular2 project is packaged using the ng build command under anguar2-cli, run the static index.html file in the dist folder. There is no problem with the first route jump, but if the page is refreshed in the jumped route, A 404 error will be returned.
GitHub code link: https://github.com/borysn/spr...
After clicking register on the main page, it will jump to the registration page normally. However, if you refresh the registration page, 404 will be returned
I don’t know if anyone else has encountered this situation. If so, please let me know the solution.
Adding {useHash:true} in the route can solve this problem
Same question, I am also looking for this problem
You can use Nginx to do a layer of routing transfer, first jump to the homepage, and then use the routing strategy to perform related rendering
Whether dynamic parameters are set for the route? If so, this problem may occur. I am also working on solving it