I created a web app with lovable.dev but facing problem with the app that when I deploy it I am not able to open pages by directly opening the pages, but when I open pages from the menu its opening.
Check: garofaloplumbingcorp.netlify.app and move to service page. You will see its opening.
But when you directly open this page pittsburgh-plumber-pros its saying 404.
Help me out to solve this problem.
@garofaloplumbingcorp This is addressed in the documentation in several places.
One of them is the warning box on this page:
Avoid 404s for SPAs
If your project is a single page app (SPA) that uses the history pushState
method to get clean URLs, you must add a rewrite rule to serve the index.html
file no matter what URL the browser requests.
The solution is to set up a ‘rewrite’ as per the instructions here:
https://docs.netlify.com/routing/redirects/rewrites-proxies/#history-pushstate-and-single-page-apps
I encountered the same problem and chatted to Lovable the following:
> “When I publish this file, I get a 404 error when reloading pages. Can you deeply investigate the issue, and ensure that I have the appropriate redirect file in the code?”
Lovable created the appropriate redirect file, problem solved.
1 Like