title: Create a dynamic vhost in apache
body: <p>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 <code>project_name</code> <code>environment</code> based on the domain which call the webserver.</p>
  
  <p>My current Vhost: </p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot "/Users/l91/Development/&lt;project_name&gt;/web"
      ServerName &lt;project_name&gt;.&lt;environment&gt;
  
      &lt;Directory "/Users/l91/Development/&lt;project_name&gt;/web"&gt;
          Options Indexes FollowSymlinks
          SetEnv SYMFONY_ENV &lt;environment&gt;
          AllowOverride All
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>