Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web S3和Route 53上静态网站的子文件夹_Web_Amazon S3_Amazon Route53 - Fatal编程技术网

Web S3和Route 53上静态网站的子文件夹

Web S3和Route 53上静态网站的子文件夹,web,amazon-s3,amazon-route53,Web,Amazon S3,Amazon Route53,我最近开始使用S3和Route 53在AWS上建立一个简单的静态网站。有很多教程可以做基本的部分,而且也没有那么复杂。我可以很好地查看主页(index.html);我只是把浏览器指向mypage.com,我正在做生意。但是,我希望有一点嵌套结构 在mypage.com aws bucket中,我有一个文件夹,mypage.com/music。在浏览器中输入该url将导致: Code: NoSuchKey Message: The specified key does not exist. 当我

我最近开始使用S3和Route 53在AWS上建立一个简单的静态网站。有很多教程可以做基本的部分,而且也没有那么复杂。我可以很好地查看主页(
index.html
);我只是把浏览器指向
mypage.com
,我正在做生意。但是,我希望有一点嵌套结构

在mypage.com aws bucket中,我有一个文件夹,mypage.com/music。在浏览器中输入该url将导致:

Code: NoSuchKey
Message: The specified key does not exist.

当我期望的是该目录内容的简单文件夹视图时。我该如何做到这一点

S3不会生成存储桶中内容的文件夹视图(当然AWS控制台中除外,但此处显示的目录列表不是由S3呈现的,而是由AWS控制台呈现的)

NoSuchKey
错误指的是
music/index.html
中没有对象

您需要将自己的目录列表呈现为静态HTML文件,并将其另存为
music/index.HTML
,或者在CloudFront中使用S3SDK/Lambda@Edge函数从服务中获取列表并提供响应