Page not found error in other pages

Hi Netlify support team,
So with the multi page sites I’ve built, I get this error for some reason. All the single page sites work fine, in the case of multi page sites, the home page works fine and any pages that gets redirected to, its fine as well. However, when you refresh the page of any other page apart from the home or enter the link of the separate page, I get the " Page not found .Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site." error. Is there something wrong with my code that’s causing the issue? I’ve built 2 multi page site so far, I am facing this problem in both of them.

Ex. with my “stratify.media” page, the home works fine and if you click on any of the page links in footer, say t&c, it redirects to the t&c page normally, but when I refresh that page or enter that specific page link in my browser, I get the error.

How could I solve this issue? I am very new to site builds and netlify. Note that the sites are getting directly deployed from Github. When asked chatgpt and asknetlify AI, it said that I should add a public redirect line of code, is that it?

Thank you

@prani ChatGPT’s answer is correct, it’s addressed in the documentation:

See:
https://docs.netlify.com/configure-builds/javascript-spas/

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 rewrite rule that you need to add is shown here:
https://docs.netlify.com/routing/redirects/rewrites-proxies/#history-pushstate-and-single-page-apps

_redirects

/*  /index.html  200

If you have other issues with “Page Not Found” you can try this support guide:
https://answers.netlify.com/t/support-guide-i-ve-deployed-my-site-but-i-still-see-page-not-found/125