AWS S3 provides 2 styles of paths for accessing S3 objects. Are there any reasons for which style should be used when?
In a virtual-hosted–style:
http://bucket.s3.amazonaws.com
http://bucket.s3-aws-region.amazonaws.com.
In a path-style URL :
http://s3.amazonaws.com/bucket
http://s3-aws-region.amazonaws.com/bucket
There's quite a bit of information regarding this in the Virtual Hosting of Buckets section of the AWS docs.
Besides the attractiveness of customized URLs, a second benefit of virtual hosting is the ability to publish to the "root directory" of your bucket's virtual server. This ability can be important because many existing applications search for files in this standard location. For example, favicon.ico, robots.txt, crossdomain.xml are all expected to be found at the root.
In short, when using the virtual hosted style you will have your files at the root directory. This means you are accessing the top level of what is basically a file structure for your domain which is handy when dealing with some applications that will search your domain at this root level for certain things such as a favicon (the little icon on the tab of the page in your browser).
Other advantages include generally having a neater looking domain. This is almost always the better option when it comes to domains unless you simply want your bucket for personal use where most of this wouldn't matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With