Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom 404 Page for Static Website using AWS S3 buckets not working

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!

like image 708
gcr828 Avatar asked Mar 29 '17 18:03

gcr828


1 Answers

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

like image 66
Geander Avatar answered Oct 02 '22 12:10

Geander