I want to simple all subdomains from *.domain.com show content of domain.com with url of subdomain. But at now it's returning me php source instead of builded page. If using *.80 virtual host then all works, but subdomains show first site in www directory because both sites use same ip.
My file structure
www
site1
site2(which content i need to show with subdomains)
content
subdomain1
subdomain2
index.php
My virtualhost in apache2.conf code.
<VirtualHost IP:PORT>
ServerName domain.com
DocumentRoot /var/www/path/data/www/domain.com
ServerAlias *.domain.com
RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.com$
RewriteRule !^index\.php$ index.php [L]
</VirtualHost>
output
<?php require(dirname(__FILE__).'/config/config.inc.php');
Dispatcher::getInstance()->dispatch(); ?>