All my vhost are the same way and I dont want to create for every project a new one so I thought there is maybe a way to match the
environment based on the domain which call the webserver.
My current Vhost:
Options Indexes FollowSymlinks
SetEnv SYMFONY_ENV <environment>
Allow from all
It sounds more like you're looking for aliases or rewrites, rather than a virtual host. You can likely use rewrite rules to find them dynamically.
Did get it to work with this configuration:
NameVirtualHost *:80 <Directory "/Users/l91/Development/Websites"> Options Indexes FollowSymlinks AllowOverride All Order allow,deny Allow from all </Directory> UseCanonicalName Off VirtualDocumentRoot /Users/l91/Development/Websites/%0/web SetEnvIf X-SYMFONY_ENV "^prod$" SYMFONY_ENV=prod SetEnvIf X-SYMFONY_ENV "^stage$" SYMFONY_ENV=stage SetEnvIf SYMFONY_ENV "^$" SYMFONY_ENV=dev
and use of the following plugin to change ENVs by setting a header: https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj