In case this S3 bucket is served from a CloudFront distribution:
Create a custom error page (AWS Docs) in CloudFront distribution that routes 404 errors to index.html and returns 200 response code.
This way your application will handle the routing.
Custom Error Pages