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!

gcr828
  • 151
  • 2
  • 8
  • Please edit your "question" to include the actual question, and the content from the unexpected/incorrect response you are seeing. – Michael - sqlbot Mar 30 '17 at 00:05
  • 1
    I'm having the same issue. Were you able to resolve this issue? – briancaffey May 14 '20 at 01: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: https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteEndpoints.html#WebsiteRestEndpointDiff – Mike Rippon Mar 23 '21 at 05:27

1 Answers1

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

Grodriguez
  • 21,501
  • 10
  • 63
  • 107
Geander
  • 388
  • 1
  • 6