react router doesn't work in aws s3 bucket

I deployed my React website build/ folder into an AWS S3 bucket.

If I go to, it works and if I click on a tag to go to Project and About pages, it leads me to the right page.
However, if I copy and send the page url or go straight to the link like:, it returns 404.

Here’s my App.js code:

const App = () => (
                <Route exact path="/" component={Home}/>
                <Route exact path="/projects" component={Projects}/>
                <Route exact path="/about" component={About}/>
                <Route component={NoMatch}/>

26 thoughts on “react router doesn't work in aws s3 bucket”