Apache Redirect With[out] WWW

It's a very simple task. You either want WWW or not, and want them to redirect. In your vhost file:

Without WWW

RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

With WWW

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Drupal actually has this in the root .htaccess file waiting for you to enable one, but for the sake of version control doing so at the vhost level seems like the better option.