De acordo com a documentação do Apache, a ordem do VirtualHost é importante. Você pode verificar a ordem do VirtualHosts executando httpd -S
.
Veja meu exemplo com uma ordem diferente do VirtualHosts:
[root@~]# httpd -S
VirtualHost configuration:
192.168.5.47:443 is a NameVirtualHost
default server dev.somedomain.tld (/etc/httpd/conf/httpd.conf:353)
port 443 namevhost dev.somedomain.tld (/etc/httpd/conf/httpd.conf:353)
wild alias *.somedomain.tld
port 443 namevhost something.dev.somedomain.tld (/etc/httpd/conf/httpd.conf:358)
wild alias *.dev.somedomain.tld
[root@~]# httpd -S
VirtualHost configuration:
192.168.5.47:443 is a NameVirtualHost
default server something.dev.somedomain.tld (/etc/httpd/conf/httpd.conf:353)
port 443 namevhost something.dev.somedomain.tld (/etc/httpd/conf/httpd.conf:353)
wild alias *.dev.somedomain.tld
port 443 namevhost dev.somedomain.tld (/etc/httpd/conf/httpd.conf:358)
wild alias *.somedomain.tld