I had set up 2 domain virtualhost files under /etc/apache2/sites-available,
www.example.com.conf
example.com.conf
apart from the default configurations. I've been trying to create a redirection from example.com to www.example.com and it doesn't seem to work, I don't know where I'm going wrong.
In www.example.com.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.example.com
DocumentRoot /var/www/project
</VirtualHost>
In example.com.conf
<VirtualHost *:80>
ServerName example.com
ServerAdmin admin@mailzak.com
DocumentRoot /var/www
Redirect / http://www.example.com/
</VirtualHost>
After adding them, I had configured with "a2ensite" and restarted Apache. But the redirection doesn't work.