Reputation: 4230
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?
Upvotes: 1
Views: 682
Reputation: 4230
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>
Upvotes: 2