I need the Apache virtualhost of my server to meet the following rule:
1- If you are domain.com or www.domain.com, then display the content at /var/www/domain.com/home
2- If it is blog.domain.com, then it displays the content in /var/www/domain.com/blog
3 - If it is a wildcard (*), that is, it is not the top two, then it displays the content in /var/www/domain.com/platform
For this to be possible I've edited my virtualhost as follows:
ServerName dominio.com
ServerAlias www.dominio.com
DocumentRoot /var/www/dominio.com/public_html/home
ServerName dominio.com
ServerAlias blog.dominio.com
DocumentRoot /var/www/dominio.com/public_html/blog
ServerName dominio.com
ServerAlias *.dominio.com
DocumentRoot /var/www/dominio.com/public_html/plataforma
And my DNS zone as follows:
@ IN A 111.111.1.111
(*) CNAME @
Doubt:
How did I do it? If not, what would it be like? Do you need to create a record in the DNS zone for www and the blog ?