简体   繁体   English

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

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

Team,团队,

I need to change the AWS S3 URL to a shorter URL version, example:我需要将 AWS S3 URL 更改为较短的 URL 版本,例如:

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

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

This is working on thousands of websites/buckets but I'm not able to find the right configuration, I'm hosting a static HTML website on Amazon S3.这适用于数千个网站/存储桶,但我无法找到正确的配置,我在 Amazon S3 上托管了一个静态 HTML 网站。

This a live working example:这是一个实时工作示例:

https://s3.amazonaws.com/walgreens-photo-coupon/walgreens/index.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/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 https://s3.amazonaws.com/dfc_attachments/public/documents/3260209/Dental_Plan_Overview_2019.pdf

How this was done it's the question?这是怎么做到的,这是个问题?

I'm getting the following error:我收到以下错误:

<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>

but I wonder if this is a generic error message.但我想知道这是否是一条通用错误消息。

You can use:您可以使用:

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

Note that it includes the region name .请注意,它包括区域名称

However, please note that this style of accessing Amazon S3 buckets is about to be turned off for new buckets .但是,请注意,对于新的存储桶,这种访问 Amazon S3 存储桶的方式即将关闭 After September 30, 2020 only the virtual-host style of naming will be available: 2020 年 9 月 30 日之后,将仅提供虚拟主机命名方式:

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

See: Amazon S3 Path Deprecation Plan – The Rest of the Story |请参阅: Amazon S3 路径弃用计划 - 故事的其余部分 | AWS News Blog AWS 新闻博客

You can also use your own domain name on Amazon S3 buckets.您还可以在 Amazon S3 存储桶上使用您自己的域名。 See: Configuring a static website using a custom domain registered with Route 53 - Amazon Simple Storage Service请参阅: 使用向 Route 53 注册的自定义域配置静态网站 - Amazon Simple Storage Service

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

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