title: mod_rewrite to ssl not working for example.com but does for example.com/index.html
body: <p>NOTE: config and error updated to be clearer.</p>
  
  <p>I have the following .htaccess for my site running apach 2.4 on Ubuntu:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  # Redirect to HTTPS
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteCond %{HTTP_HOST} ^(www\.)example1.com [OR]
  RewriteCond %{HTTP_HOST} ^(www\.)example2.com
  RewriteRule ^(.*)$ https://www.example2.com/$1 [L,R=301]
  &lt;/IfModule&gt;
  </code></pre>
  
  <ul>
  <li><p>If I go to <a href="http://example2.com" rel="nofollow">http://example2.com</a>, <code>http://www.example2.com or</code><a href="http://www.example1.com" rel="nofollow">http://www.example1.com</a><code>it redirects to</code>https` </p></li>
  <li><p>if I go to <code>http://example1.com</code> it stays as http.</p></li>
  </ul>
  
  <p>Is there something I am missing so that it will redirect with just the base <code>/</code> url?</p>