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