0

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?

1
  • Did you get a solution to this? I am facing the same issue in my Ionic web app Commented Dec 23, 2021 at 12:15

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

3 Comments

I have done that, but now it goes to index page and not does not open that url page what do i do now ?
The issue in your case might be that you are deploying to a subfolder /qanda/pwa. Are you running ionic build --prod -- --base-href /qanda/pwa/ ?
No, only ionic build --prod, I am travelling at the moment, I'll test it in next 8 hours as you have guided and let you know
1

This regularly should not happen and you can't do anything for this. Try to upgrade your ionic to the latest with nodejs since the error my be from currupted project creation. Then after update create a new project and it should go good.

2 Comments

it is working offline but when i am uploading it to my server it is not working, any guesses why, here is the link u can check - sapphireprofits.com/qanda/pwa
It is working well.I think its related to your browser since it 100% working without any problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.