title: Trouble redirecting subdomains to a folder
body: <p>I have got this working:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.co\.uk
  RewriteRule ^(.*) http://domain.co.uk/%1 [L]
  </code></pre>
  
  <p>So it will redirect test.domain.co.uk to test.domain.co.uk/test</p>
  
  <p>However, I would like it so that it changes the document root rather than the user seeing the redirect. I have read a few articles on here and tried a few things. But I am not sure how to debug any errors, it just doesn't work. The one other that I have tried:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_URI} !^/-
  RewriteCond %{HTTP_HOST} ^([^\./]+)
  RewriteCond %{DOCUMENT_ROOT}/-%1 -d
  RewriteRule ^(.*)$ -%1/$1 [L] 
  </code></pre>
  
  <p>But this doesn't seem to work at all.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Ian</p>