title: AWS Cloudfront distribute multilingual angular apps
body: <p>I have an Angular app which is store in a AWS S3 bucket and distributed by Cloudfront.</p>
  
  <p>Now I want to distribute my app in multiple languages. I've already translated my angular app and for each language I have on build.</p>
  
  <p>So my S3 bucket looks like this:</p>
  
  <pre><code>de
     /index.html
     /script.js
  en
     /index.html
     /script.js
  </code></pre>
  
  <p>For each language I want to serve another app.</p>
  
  <p>In Cloudfront I created  two Origins which points to Origin Path <code>/de</code> and <code>/en</code></p>
  
  <p>So my URL schema is like this:</p>
  
  <pre><code>&lt;appname&gt;.&lt;mydomain&gt;.com/:lang
  </code></pre>
  
  <p>But my problem is, I dont get the Error Pages to work with these specific  language folders.
  I need these Error Response Handlers to deliver the angular app(s) when a 404 occurred (due to a reload)</p>
  
  <p>Does anyone know how I can solve this? Or should i create one more subdomain for each language? So it looks like this:</p>
  
  <pre><code>&lt;lang&gt;.&lt;appname&gt;.&lt;mydomain&gt;.com
  </code></pre>