我正在为 Amazon S3 中的一些私有(private)信息生成一些签名 URL
如果签名链接已过期,或者对象不存在,则会报告 XML 错误以及 404 错误(或 403 禁止)。
是否可以将签名链接 404 重定向到自定义错误页面?这似乎与 S3 静态网站设置的 404 错误页面不同。
到目前为止,我的研究表明,如果您使用静态页面,则所有内容的权限必须是公开可读的,并且您无法生成签名 URL(或者我做错了)或者如果您使用签名 URL 404 错误不会重定向,您只会收到 XML 错误。
我找到的所有链接都指向使用静态页面,但我认为这不适用于这种情况。
最佳答案
你想要的可能是这样的: 在Developer guide有一段关于“自定义错误文档支持”的段落,我在其中阅读了以下句子。
You can optionally provide a custom error document with a user-friendly error message and with additional help. You provide this custom error document as part of adding website configuration to your bucket. Amazon S3 returns your custom error document for only the HTTP 4XX class of error codes.
https://stackoverflow.com/questions/16329130/