문제

Let's say I want all requests to https://example.com/api/users/1 redirected to http://api.example.com/users/1 using a AWS S3 bucket.

So all requests to the "directory" api should be redirected to the subdomain api.example.com

Can somebody provide a RoutingRule for that?

도움이 되었습니까?

해결책

Here is the RoutingRule I ended up with:

<RoutingRules>
    <RoutingRule>
        <Condition>
            <KeyPrefixEquals>api/</KeyPrefixEquals>
        </Condition>
        <Redirect>
            <HostName>api.example.com</HostName>
            <ReplaceKeyPrefixWith/>
        </Redirect>
    </RoutingRule>
</RoutingRules>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top