I have stored my single-page application in my server within a folder named as "myapp". I have changed the URL in the base to http://example.com/myapp/`.
My project has two pages. So I implement Angular 2 routing. I set the default page as login. When I type http://example.com/myapp/
in my browser it will redirect automatically to http://example.com/myapp/login
. But if refresh that page I get a 404
error, saying that http://example.com/myapp/login
is not found.
But if I run my project using the lite server everything is working. In this case the base URL in index.html will be "/"
. How do fix it?