react router doesn't work in aws s3 bucket

前端 未结 12 1511
深忆病人
深忆病人 2020-11-28 08:08

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

If I go to www.mywebsite.com, it works and if I click on a ta

12条回答
  •  感动是毒
    2020-11-28 08:30

    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

提交回复
热议问题