重定向到Amazon S3静态网站中的错误页面

问题描述:

我有一个存储桶并在其中启用了静态网站托管.

i have a bucket and enabled static web site hosting in it.

说我存储桶中只有两个文件(index.html)和(error.html)

Say i have only two files in the bucket (index.html) and (error.html)

如果使用test.html命中请求,则拒绝访问或不引发此类键错误.

If a request is hit with test.html, either access denied or no such key error is thrown.

如果发生此类错误,如何重定向到error.html?

How to redirect to error.html in case of such errors ?

在S3管理控制台中,打开存储桶的属性并启用静态网站托管".它将要求您提供索引页面和错误页面,并为您的静态网站提供终结点.

In the S3 Management Console, open the properties of your bucket and enable the "Static Website Hosting". It will ask you for an index page and an error page and provide you an endpoint for your static website.

请参阅: http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html