title: Getting a part of URL in apache
body: <p>I have set wildcard vhosts in my apache like</p>
  
  <pre><code>&lt;VirtualHost *&gt;
    ServerName wildcard.test.com
     ServerAlias *.test.com
  
     DocumentRoot = /var/www/test
     # other configuration for this app here
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I have created some sub domains like <code>front.test.com</code> and <code>admin.test.com</code>. I just want to know if there is a way in <strong>APACHE</strong> to get the first part of the URL like in above cases, I want <strong>test</strong> and <strong>admin</strong> and send it to my server side language some how. I repeat that I am looking for a possible way in apache, as people always say</p>
  
  <blockquote>
    <p>you can not always trust what $_SERVER returns
    I will go for server side after confirming that there is not any way doing it on apache 
    Thanks</p>
  </blockquote>