Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
It only seems to be an issue when www. is in front of the address; otherwise it doesn’t redirect. Maybe its because of the ServerName, ServerAlias combo I used?
If your VirtualHost’s DocumentRoot is set to /var/www, you will need to set it to /var/www/html so that http://yourdomain.tld/ maps to /var/www/html instead of /var/www.
Open your VirtualHost file in nano:
sudo nano /etc/apache2/sites-enabled/virtual-host
and set DocumentRoot to /var/www/html.
Then restart Apache:
sudo service apache2 restart