Alexej Haak
Alexej Haak

Reputation: 480

Host index.html in subfolders of S3 Bucket

Static website hosting is working in the root directory, but this is not working for me:

my.bucket/index.html
my.bucket/subfolder/index.html

https://s3-eu-west-1.amazonaws.com/my.bucket works as expected

https://s3-eu-west-1.amazonaws.com/my.bucket/subfolder doesn't work (Access Denied)

Is this possible?

Upvotes: 9

Views: 4259

Answers (2)

Chris Huang-Leaver
Chris Huang-Leaver

Reputation: 6089

There are (at least) three ways to access a static website hosted in AWS.

  • The S3 bucket name
  • The CDN name. (which is what the "host a static website" wizard tells you to use)
  • The "Static website hosting endpoint" which is listed on the S3 bucket management page

Only the "static website hosting endpoint" filters incoming requests to give Apache like behaviour; S3 is a RESTful API for storing files with no concept of subfolders.

If you have used the wizard, there is "Manage file in S3" in tiny text at the bottom left of the screen, which will open up the correct page in the console for you, then click the 'properties' button.

Upvotes: 1

user1832464
user1832464

Reputation:

You need to modify the permissions of the sub-folder as well to make it publicly accessible.

Upvotes: 0

Related Questions