title: Sub-domain as variable in mod_rewrite
body: <p>I am trying to mod-rewrite based on a sub-domain. How do I take the subdomain and append it to the end of my new domain?</p>
  
  <p>Example:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^users\.example\.com$
  RewriteRule ^(.*)$    http://www.example.com/?subdomain=[variable for sub]     [L]
  </code></pre>
  
  <p>How do I get 'users' into [variable for sub]?</p>