Is there a way to have index.html functionality with content hosted on S3?

后端 未结 7 1392
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 11:57

Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing:

/index.html
/favicon.ico
/images/logo.gif

A call

7条回答
  •  旧时难觅i
    2020-12-24 12:24

    Amazon S3 now supports Index Documents

    The index document for a bucket can be set to something like index.html. When accessing the root of the site or a sub-directory containing a document of that name that document is returned.

    It is extremely easy to do using the aws cli:

    aws s3 website $MY_BUCKET_NAME --index-document index.html
    

    You can set the index document from the AWS Management Console:

    enter image description here

提交回复
热议问题