0

The app is pretty simple: it just contains any number of blank (newly created) angular components, they don't do anything. So when I go to localhost/component1 I can see that it displays the default static text and it's ok. Then I refresh the page and it's still ok. But it throws 404 when I deploy the project to the remote server and follow exact the same instructions: go to myserver.com/component1 and click refresh page. Why it happens? Is there a way to redirect to some page in the case of exception?

PS Also noticed that if (on the prod server) first I go to myserver.com/component1 then it throws 404, but if I first go to myserver.com and then click on myserver.com/component1 then it's fine. No such the problem on localhost (dev machine).

Joe Doe
  • 39
  • 1
  • 1
  • 5
  • Does this answer your question? [Angular 2.0 router not working on reloading the browser](https://stackoverflow.com/questions/31415052/angular-2-0-router-not-working-on-reloading-the-browser) – Tu.Ma. Jul 26 '20 at 09:53
  • Or this one: https://stackoverflow.com/questions/35284988/angular-2-404-error-occur-when-i-refresh-through-the-browser – Tu.Ma. Jul 26 '20 at 09:54
  • Maybe you can refer to [this](https://stackoverflow.com/questions/50907736/refreshing-the-page-results-in-404-error-angular-6) – Yiyi You Jul 27 '20 at 02:49

0 Answers0