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