9

I have added in my bucket properties "static website hosting", then "use this bucket to host a website" and added 404.html to the "error document". After that I added the actual 404.html to my bucket. and it still doesn't work. Is there a step I'm missing?

Any help would be appreciated!

3
  • Please edit your "question" to include the actual question, and the content from the unexpected/incorrect response you are seeing. Commented Mar 30, 2017 at 0:05
  • 1
    I'm having the same issue. Were you able to resolve this issue? Commented May 14, 2020 at 1:12
  • If the site is accessed via Cloudfront, and the origin URL is to the rest API (yourbucket.s3.region.amazonaws.com) then custom error pages won't work. You can use the bucket's website address (yourbucket.s3-website.region.amazonaws.com), but the bucket and it's contents have to be made public. Source: docs.aws.amazon.com/AmazonS3/latest/userguide/… Commented Mar 23, 2021 at 5:27

1 Answer 1

6

If your S3 bucket has "Static website hosting" turned on, you can set an error page.

S3 configuration screenshot

If there is any engine like Angular js or Reactjs, you can set the error page in the app.

And another option is to put Amazon CloudFront in front of S3, in it you can also customize the error pages, by several status codes (404, 500, etc.):

http://docs.aws.amazon.com/pt_br/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.