<VirtualHost *:80>
ServerAdmin root@example.com
ServerName www.example.com
ServerAlias example.com
Protocols h2 http/1.1
<If "%{HTTP_HOST} == 'example.com'">
Redirect permanent / http://www.example.com/
</If>
DocumentRoot /var/www/www.example.com/public_html
<Directory "/var/www/www.example.com/public_html/">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/www.example.com-error.log
CustomLog ${APACHE_LOG_DIR}/www.example.com-access.log combined
</VirtualHost>