title: Htaccess redirect https to another https
body: <p>We have just bought the .com extension for our domain and we are using ssl certificates on both of them:</p>
  
  <pre><code>https://www.domain.net
  https://www.domain.com
  </code></pre>
  
  <p>Now we would like to use the .com extension <strong>only</strong> and redirect our users from the old domain to the new one using the htaccess file:</p>
  
  <pre><code>http[s]://domain.net -------|
  http[s]://www.domain.net ---|---&gt; https://www.domain.com
  http[s]://domain.com -------|
  </code></pre>
  
  <p>I am not very familiar with htaccess so I tried:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTP_HOST} ^http[s]?://(www\.)?domain\.com(.*)?$
  RewriteRule ^(.*)$ http[s]?://www.domain.com/? [R,L]
  </code></pre>
  
  <p>That obviously doesn't work!</p>
  
  <p>Any help would be greatly appreciated.</p>