title: using .htaccess to find subdomain files
body: <p>I have a site <code>example.com</code> whose files are at <code>/path/to/example/</code> It has subdomains <code>subdomain.example.com</code> whose files are at <code>/path/to/example/subdomain/</code> How can I serve these files using <code>.htaccess</code> without redirection?</p>
  
  <p>I tried</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^subdomain.example.com
  RewriteRule ^(.*)$ http://example.com/subdomain/$1 [L]
  </code></pre>
  
  <p>but this redirects users to a new page. </p>
  
  <p>I also tried</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^subdomain.example.com
  RewriteRule ^(.*)$ /subdomain/$1 [L]
  </code></pre>
  
  <p>but this gives a server error. </p>