title: Redirect all AWS S3 http requests to index.html for AngularJS HTML5Mode
body: <p>How do I redirect all requests to my static AWS S3 website to index.html so I can use AngularJS' HTML5 Mode?</p>
  
  <p>I recently learned (to my unending delight) that it is possible to use AngularJS without the <code>#</code> in the URL by using <a href="https://stackoverflow.com/a/16678065/5031373">HTML5 Mode</a>.  However, I know from <a href="https://stackoverflow.com/a/26068792/5031373">this answer</a> that this requires some setup on the server, since all requests have to be redirected to the right html file (in this case, <code>index.html</code>) for this to work.</p>
  
  <p>I use AWS S3's static website hosting for my site.  I tried adding this to my redirection rules:</p>
  
  <pre><code>&lt;RoutingRules&gt;
       &lt;RoutingRule&gt;
           &lt;Redirect&gt;
               &lt;ReplaceKeyWith&gt;/&lt;/ReplaceKeyWith&gt;
           &lt;/Redirect&gt;
       &lt;/RoutingRule&gt;
  &lt;/RoutingRules&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;RoutingRules&gt;
       &lt;RoutingRule&gt;
           &lt;Redirect&gt;
               &lt;ReplaceKeyWith&gt;index.html&lt;/ReplaceKeyWith&gt;
           &lt;/Redirect&gt;
       &lt;/RoutingRule&gt;
  &lt;/RoutingRules&gt;
  </code></pre>
  
  <p>but I get issues with too many redirects.</p>
  
  <p>Is there a way to do the kind of redirection necessary in AWS S3 with the static website hosting?</p>