I have the following virtual hosts:
<VirtualHost *:443>
ServerName article.example.com
AliasMatch "^/(.*)" "/var/www/html/article.php"
</VirtualHost>
<VirtualHost *:443>
ServerName company.example.com
AliasMatch "^/(.*)" "/var/www/html/company.php"
</VirtualHost>
I would like to put everything under one virtual host like so:
<VirtualHost *:443>
ServerName example.com
ServerAlias *.example.*
AliasMatch "^(article|company)\.example\.*/(.*)" "/var/www/html/$1.php"
</VirtualHost>
Is this possible? Do I have to use mod rewrite? I want map certain subdomains to related files on my server without changing the url. I want article.example.com/test-article
to map to article.php
.