【发布时间】:2018-03-04 06:30:07
【问题描述】:
我有一个亚马逊 S3 存储桶,为来自 S3bucketurl.com/foo/index.html 的网站提供服务。
我想配置一个redirection rule,自动重写URL如下:
访问S3bucketurl.com 应自动重定向到S3bucketurl.com/foo,并提供包含在子文件夹foo 中的index.html 文件。
我尝试这样设置重定向规则:
<RoutingRules>
<RoutingRule>
<Condition>
<KeyPrefixEquals>/</KeyPrefixEquals>
</Condition>
<Redirect>
<ReplaceKeyWith>api</ReplaceKeyWith>
</Redirect>
</RoutingRule>
</RoutingRules>
导致404:
404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: index.html
我还尝试了<ReplaceKeyWith>/api</ReplaceKeyWith>、<ReplaceKeyWith>api/</ReplaceKeyWith> 和<ReplaceKeyWith>/api/</ReplaceKeyWith> 的排列,但无济于事。
【问题讨论】:
标签: amazon-web-services redirect amazon-s3 url-rewriting amazon