![如何配置 aws s3 bucket 进行 307 重定向](https://linux22.com/image/723301/%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AE%20aws%20s3%20bucket%20%E8%BF%9B%E8%A1%8C%20307%20%E9%87%8D%E5%AE%9A%E5%90%91.png)
答案1
您应该能够使用路由规则配置此行为。选择“使用此存储桶托管网站”,然后添加以下内容:
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>403</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<Protocol>https</Protocol>
<HostName>other-site.example.com</HostName>
<HttpRedirectCode>307</HttpRedirectCode>
</Redirect>
</RoutingRule>
</RoutingRules>
https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
由于 S3 默认拒绝所有访问,因此无论请求什么路径,都会触发重定向。