使用AWS S3存储桶的静态网站的自定义404页面不起作用 [英] Custom 404 Page for Static Website using AWS S3 buckets not working

查看:277
本文介绍了使用AWS S3存储桶的静态网站的自定义404页面不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在存储桶属性中添加了静态网站托管",然后使用此存储桶托管网站",并将404.html添加到了错误文档"中.之后,我将实际的404.html添加到了我的存储桶中.而且仍然无法正常工作.我缺少步骤了吗?

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!

推荐答案

如果您的S3存储桶已打开静态网站托管",则可以设置错误页面.

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

如果有Angular js或Reactjs之类的引擎,则可以在应用程序中设置错误页面.

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

另一种选择是将Amazon CloudFront置于S3的前面,您还可以通过几种状态代码(404、500等)来自定义错误页面:

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

这篇关于使用AWS S3存储桶的静态网站的自定义404页面不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆