1

S3 buckets can be configured for "Static Website hosting" to redirect requests to another domain. These redirects are 301's which are forever.

enter image description here

How can I configure the redirects as 307's?

0

1 Answer 1

4

You should be able to configure this behavior using routing rules. Select "Use this bucket to host a web site" and then add these:

<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

Since S3 denies all access by default, this triggers a redirect regardless of what path is requested.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .