I'm using S3 routing rules to deprecate an old domain, routing the traffic to a new domain. So, the old domain was product.com, and the new location is my-organization.com/product/.
I am using routing rules to redirect pages. So, I have a rule like this that redirects the FAQ:
<Condition>
<KeyPrefixEquals>faq</KeyPrefixEquals>
</Condition>
<Redirect>
<Protocol>https</Protocol>
<HostName>my-organization.com</HostName>
<ReplaceKeyPrefixWith>product/faq</ReplaceKeyPrefixWith>
<HttpRedirectCode>301</HttpRedirectCode>
</Redirect>
This works well!
The one thing left to do is redirect the old homepage to the product page. I've tried using / to match the homepage:
<KeyPrefixEquals>/</KeyPrefixEquals>
But it doesn't seem to match anything. And I've tried matching on the empty key:
<KeyPrefixEquals></KeyPrefixEquals>
But that matches everything. Is there a way to just redirect the homepage in S3 routing rules? What I want is something like:
<Condition>
<KeyPrefixEquals>/</KeyPrefixEquals>
</Condition>
<Redirect>
<Protocol>https</Protocol>
<HostName>my-organization.com</HostName>
<ReplaceKeyPrefixWith>product/</ReplaceKeyPrefixWith>
<HttpRedirectCode>301</HttpRedirectCode>
</Redirect>
Thanks!