Search code examples
reactjsherokunetlify

Netlify page not found 404 after clicking a button


I'm new to here, just have a question and want to solve it. I have deployed my app on netlify, everything works fine at localhost, but when I tested it on netlify with a function. It threw an error like this. The page not found but when I tried reloading with that same URL, It still accessed. I use heroku for deploying api and netlify for client.

So what is the problem here? Can anyone help me, thanks!

My app for anyone would like to test: http://myblogapp123.netlify.app

enter image description here


Solution

  • create a file inside the public folder. Name it "_redirects"

    inside _redirects file, paste this: /* /index.html 200

    Then build your project and deploy it again. Hopefully, It'll work.