繁体   English   中英

托管静态网站时如何将 AWS S3 存储桶长 URL 更改为短 S3 URL?

[英]How to change AWS S3 bucket long URL to short S3 URL when hosting a static website?

团队,

我需要将 AWS S3 URL 更改为较短的 URL 版本,例如:

当前: https : //trabajos-costa-rica.s3.us-east-2.amazonaws.com/index.html

需要改成:https ://s3.amazonaws.com/trabajos-costa-rica/index.html

这适用于数千个网站/存储桶,但我无法找到正确的配置,我在 Amazon S3 上托管了一个静态 HTML 网站。

这是一个实时工作示例:

https://s3.amazonaws.com/walgreens-photo-coupon/walgreens/index.html

https://s3.amazonaws.com/orlando-cremation-services/average-cost-of-cremation-in-orlando-florida-call-us-at-407-250-9846-2.html

https://s3.amazonaws.com/dfc_attachments/public/documents/3260209/Dental_Plan_Overview_2019.pdf

这是怎么做到的,这是个问题?

我收到以下错误:

<Error>
<Code>PermanentRedirect</Code>
<Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message>
<Endpoint>trabajos-costa-rica.s3.amazonaws.com</Endpoint>
<Bucket>trabajos-costa-rica</Bucket>
<RequestId>C8632DF84734CE4A</RequestId>
<HostId>KyFNBQtuz2pwDPBMquz72kvozKWHOB3uN1ctiSKtuxvBqSvh9AaRISIQlqelOelLlQITGQCAwBs=</HostId>
</Error>

但我想知道这是否是一条通用错误消息。

您可以使用:

https://s3-us-east-2.amazonaws.com/trabajos-costa-rica/index.html

请注意,它包括区域名称

但是,请注意,对于新的存储桶,这种访问 Amazon S3 存储桶的方式即将关闭 2020 年 9 月 30 日之后,将仅提供虚拟主机命名方式:

https://trabajos-costa-rica.s3.amazonaws.com/index.html

请参阅: Amazon S3 路径弃用计划 - 故事的其余部分 | AWS 新闻博客

您还可以在 Amazon S3 存储桶上使用您自己的域名。 请参阅: 使用向 Route 53 注册的自定义域配置静态网站 - Amazon Simple Storage Service

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM