title: Angular 4 - Error 404 while redirect to https with .htaccess
body: <p>In production, I build my application with :</p>
  
  <p><code>ng build --prod --aot false</code></p>
  
  <p>I have two Apache configurations, one in vhost, other in .htaccess file on the root of my dist folder.</p>
  
  <p>In my vhost :</p>
  
  <pre><code>RewriteEngine on
  
  # Don't rewrite files or directories
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]
  
  # Rewrite everything else to index.html
  # to allow html5 state links
  RewriteRule ^ index.html [L]
  </code></pre>
  
  <p>In my .htaccess file :</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301, L]
  </code></pre>
  
  <p>When I launch my application, click on links it's work, I'm in https.
  When I refresh my page or I type directly URL in the browser, I have a 404 error.</p>