简体   繁体   中英

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:

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

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.

This a live working example:

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

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 . After September 30, 2020 only the virtual-host style of naming will be available:

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

See: Amazon S3 Path Deprecation Plan – The Rest of the Story | AWS News Blog

You can also use your own domain name on Amazon S3 buckets. See: Configuring a static website using a custom domain registered with Route 53 - Amazon Simple Storage Service

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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