For reasons uknown I can not appear to obtain this right, I have checked out many good examples on here and apache's website. I am attempting to pressure www.domain.com rather than domain.com on EITHER http or https but I'm not attempting to pressure https over http.

the next code appears to dedicate yourself all https connections but http won't redirect to www.

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^ https://www.domain.com%{REQUEST_URI} [R=301]

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^ http://www.domain.com%{REQUEST_URI} [R=301]
  1. You do not need the 2nd RewriteEngine directive. That might be leading to a parse problem making the 2nd algorithm not work. To check whether this is actually the situation, try switching an order of these two blocks you've.
  2. It is good practice to make use of L to change demands which are certainly the final. So, change [R=301] to [R=301,L] both occasions it seems.
  3. Largely ought to be style, I'd consider altering the RewriteRule directives to something similar to (using http or https as appropriate):

    RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L,QSA]

Your rules appear to become fine. You are able to mix them the following:

RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteCond %{HTTPS}s on(s)|
RewriteRule ^ http%1://www.example.com%{REQUEST_URI} [L,R=301]

Also note the extra L flag to prevent the spinning process following this rule continues to be applied.