Frage

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?

War es hilfreich?

Lösung

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>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top