Angular 2: 404 error occur when I refresh through the browser

I’m new to Angular 2. 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`.

My project have two pages. So I implement Angular 2 routing. I set the default page as login. When I type in my browser it will redirect automatically to But if refresh that page I get a 404 error, saying that is not found.

But if I run my project using the lite server everything is working. In this case base the URL in index.html will be "/". How do fix it?