Q:

Can a conditional logic be added to htaccess multisite to redirect to www and https except for a single domain?

I'm trying to find a conditional logic solution for htaccess on my Wordpress Multisite.
I have found considerable speed improvements to the sub-sites by forcing a redirect of each domain to https and www versions by inputing in the htaccess file directly.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

The problem I'm facing is that the primary domain is a non-www site and that too is redirecting.  I already know a solution where I can input each domain in the htaccess file individually but that slows down the load time of the sites.
What I'm looking to do is to perform a conditional statement to accommodate this, such as:
If website is domain1.com then make no changes else perform the following rewrite/redirect to www and https.
Does such a method exist?

A:

Yes, as of Apache 2.4 there are If, ElseIF and Else directives that you can use to achieve what you are thinking. 
To implement it you would use something like this:
<If "req('Host') !~ /domain1.com/i">
   {{ Rewrite rules you only want to apply if the domain isn't domain1.com }}
</If>

Sources:

Apache Blog: New in httpd 2.4: If, ElseIf, and Else 
Apache 2.4 Documentation: If Directive

