title: htaccess RewriteRule for subdomain
body: <p>Say I have the following site:</p>
  
  <p><a href="http://example.com/site" rel="nofollow">http://example.com/site</a></p>
  
  <p>that is the same of</p>
  
  <p><a href="http://site.example.com" rel="nofollow">http://site.example.com</a></p>
  
  <p>I was wondering if I could obtain something like this</p>
  
  <blockquote>
    <p><strong>http://site.example.com/var/</strong></p>
  </blockquote>
  
  <p>using apache2's mod_rewrite.</p>
  
  <hr>
  
  <p>Here's my try:</p>
  
  <pre><code>RewriteEngine on
  RewriteRule ^([^/\.]+)$ /site/?var=$1
  </code></pre>
  
  <p>this works like a charm when the URL is <a href="http://example.com/site" rel="nofollow">http://example.com/site</a>, but since I'm just a beginner I don't know how to get this to work for <a href="http://site.example.com" rel="nofollow">http://site.example.com</a>.</p>
  
  <p>Any help would be really appreciated.</p>