title: Redirect subdomain to subdirectory
body: <p>i've already read all topics here and on google about redirection but i'm a programmer and i cant get it going.  <br /><br />
  I have Apache 2.2 installed. The web root is C:\Apache\htdocs. My network admin set me up a local domain that points to the server with Apache. The domain is myPhpApp.ourcompany.local. And this subdomain works, it shows the Apache "It works" page.  <br /><br />
  Now i have a website in C:\Apache\htdocs\myPhpApp and i want Apache to redirect the myPhpApp.ourcompany.local to this directory. The URLs should stay while browsing the website always as myPhpApp.ourcompany.local for example: myPhpApp.ourcompany.local/index.php, myPhpApp.ourcompany.local/data.php and so on. <br /><br />
  I dont know how to achieve this? Mod-rewrite, virtual hosts, combination of both?
  i have got this and this does not work:</p>
  
  <pre><code>&lt;VirtualHost myphpapp.ourcompany.local&gt;
  DocumentRoot /myphpapp/
  ServerName www.example1.com
  
  RewriteEngine on
  RewriteRule   ^/$  /myphpapp/  [R]
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>In effect i get: </p>
  
  <blockquote>
    <p>Forbidden</p>
    
    <p>You don't have permission to access
    /myphpapp/ on this server.
    Can anyone help?</p>
  </blockquote>
  
  <p><strong>EDIT</strong>
  Maybe i forgot to mention: i dont put this into the www root which is C:/Apache/htdocs becuase i have more apps in there. 
  i have 3 directories in thdocs: myphpapp, myoldapp, mytestapp. As a target i want to have 3 subdomains that point to each directory.</p>