title: apache redirect http to https and www to non www
body: <p>basically what i want is redirect al request to use HTTPS instead of http </p>
  
  <p>I have this in my htaccess so far and it worked great: 
  Code:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt; 
  RewriteEngine On 
  RewriteCond %{HTTPS} off 
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 
  &lt;/ifModule&gt; 
  </code></pre>
  
  <p>today someone noticed that when going to: 
  <a href="http://www.example.com" rel="noreferrer">http://www.example.com</a> it redirects to  and shows an unsecure connection thingie. </p>
  
  <p>My ssl is setup for non www domain: mydomain.com </p>
  
  <p>So i need to make sure all site requests are sent to non www and https: 
  It works fine if i put example.com it redirects to <a href="https://example.com" rel="noreferrer">https://example.com</a> </p>
  
  <p>but with www.example.com it goes to htts://www.example.com and shows the error </p>
  
  <p>what do i need to add to my code to redirect www to non www and then to ssl 
  ?</p>