<VirtualHost 123.123.123.123:80>
ServerName www.site.com
ServerAlias site.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.site\.com$ [nocase]
RewriteRule ^(.*)$ http://www.site.com$1 [last,redirect=301]