title: htaccess redirect rules conflict with eachother
body: <p>I need to write my htaccess to do the following. </p>
  
  <p>1) I want to redirect example.com/blog/whatever into blog.example.com/whatever (NO HTTPS)</p>
  
  <p>2) example.com --> <a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a> (HTTPS and add WWW)</p>
  
  <p>The following is my htaccess. The blog part works fine when it is uncommented,  but when I uncomment those two lines related to blog, the www.mydomain.com does not work anymore and I get nothing in the browser, not even 404. If I comment those two line (like it is now) then everything works fine but not the blog part. </p>
  
  <p>Can someone please help me to figure this out so I can have both rules work at the same time. </p>
  
  <pre><code>RewriteEngine on
  
  RewriteCond %{SERVER_PORT} 80
  
  #blog config 
  
  #RewriteRule ^blog$ http://blog.example.com/ [P,L,R=301]
  
  #RewriteRule ^blog/(.*)$ http://blog.example.com/$1 [P,L,R=301]
  
  
  # forward all the request to https and www
  
  RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
  
  
  # Framework purposes
  
  RewriteCond $1 !^(index\.php|assets)
  
  RewriteRule ^(.*)$ index.php?/$1 [L]
  </code></pre>
  
  <p>So basically the problem is when I have these two rules together (blog part and force https) they don't work together, however each individually work if I uncomment the other one.</p>