title: Redirect an Old Domain to a New Domain with HTTPS in .htaccess
body: <p>Let's say we have, <br><br> Old Domain : <code>http://www.olddomain.com</code> 
  <br>
  New Domain : <code>https://www.newdomain.org</code></p>
  
  <p>Here's my .htaccess file data :<br></p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
  RewriteRule ^/?$ "https\:\/\/www\.newdomain\.org\/" [R=301,L]
  </code></pre>
  
  <p>Sometimes while redirection, browsers are displaying the Security error such that it is untrusted. <br></p>
  
  <p>Now, </p>
  
  <ol>
  <li>How to make this successfull ?</li>
  <li>How to redirect this from non-www to www ?</li>
  </ol>