willmahon
willmahon

Reputation: 339

Is it possible to change the url pathnames for images stored in an AWS S3 bucket?

I'm saving images uploaded by users into an aws s3 bucket, and when they're saved they have a url that looks like this https://<S3-BUCKET-NAME>.s3.eu-west-2.amazonaws.com/<SOME-RANDOM-ID>.png.

Is there a way I can change this url so it looks like https://<MY-WEBSITE-DOMAIN>/image/<SOME-RANDOM-ID> instead?

Upvotes: 0

Views: 1003

Answers (1)

Yayotr&#243;n
Yayotr&#243;n

Reputation: 1869

These URLs are public, means they can be accessed from the public internet.

If you want your users to access them through a different URL then you need a domain and route from that domain to S3. For example: https://my-domain.com/image.png routes to https://.s3.eu-west-2.amazonaws.com/image.png

Route53 supports this, take a look to AWS Documentation on how to route from R53 to S3.

Upvotes: 2

Related Questions