Client side routing for a SPA and static hosting

How can I make sure all URLs go to index.html for my React app, while using Replit static hosting?

My Replit:

Example 404:

But this works:

I created a _redirects file and copied it into my dist folder during build time, but that didn’t seem to work.

You cannot do this easily, if at all on static deployments.