I have a project in Ionic 4, when I do ionic serve
it runs at localhost:8100/
Now when it loads home page, the URL is localhost:8100/home
, if I open contact page the URL becomes localhost:8100/contact
.
When I try to copy the above URL and hit, then it says -
Sorry, this page doesn't exist. Please check the URL or go back a page.
What do I need to do to get this working?
Based on your comments this is happening because your server does not support fallback. So when you enter a url manually, the server is trying to find that page, but you only have index.html in your app because of Client side routing.
If the app uses the Angular router, you must configure the server to return the application's host page (index.html) when asked for a file that it does not have.
The configuration is specific to your server or cloud platform. You can check Angular deployment for more info.