Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subdomains for S3 Bucket Folders

I want to dynamically route subdomains to S3 bucket folders. Whats the best way to achieve this?

Example:

I have a bucket called 'example' which has two folders, one called 'A' and another one called 'B'. Now I want to dynamically route a.example.com to folder 'A' and b.example.com to folder 'B'...and so on.

Hope this makes sense

Thanks

like image 442
Matthias Avatar asked Dec 08 '25 09:12

Matthias


1 Answers

It does make sense, but you can't do it. You can configure S3 and DNS to route one hostname to one bucket, but not to just part of a bucket.

If, instead of folders, you were willing to use two different buckets, then it is easy to set up the redirection of the two hostnames to the two different buckets.

like image 113
Charles Engelke Avatar answered Dec 10 '25 04:12

Charles Engelke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!