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.
Accepted Answer
You can try mod-vhost-alias.
SummaryThis module creates dynamically configured virtual hosts,
by allowing the IP address and/or the Host: header of the HTTP request
to be used as part of the pathname to determine what files to serve.
This allows for easy use of a huge number of virtual hosts with similar configurations.
You can use VH like following:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
VirtualDocumentRoot /var/www/%0/html
<Directory /var/www/%0/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I tested it and it worked for me.
%0 means it will substitute it with full link. So if someone goes example.example.com, it’ll use it.
You can also use %1, to use only first part. For more look at above link provided.
Edit, Just to note, you need to add wildcard CNAME record @ to make desired effect.