Apache force www subdomain
A redirect in an apache vhost to force the website to www.$domain.tld
<VirtualHost *:80>
...
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
# test and reload
apachectl -t && apachectl -k graceful