I deployed my React website build/ folder into an AWS S3 bucket.
build/
If I go to www.mywebsite.com, it works and if I click on a ta
www.mywebsite.com
a
Redirecting 4xx to index.html would work, but that solution would make you fall into many other problems like google won't be able to crawl these pages. Please check this link, it solved this issue by using redirection rules for the S3 bucket.