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).