title: .htaccess redirect domain to subdirectory without changing URL
body: <p>I have the following setup:
  -> domain1.com is my main domain and also document root
  -> domain2.com is another domain which is registered as an alias domain (means it does exactly the same as domain1.com), I have multiple of those domains.</p>
  
  <p>when I now want to redirect that domain to something I usually use this to redirect the domain to something else (like an external website):</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^(www\.)?domain2.com$ [NC]
  RewriteRule ^(.*) http://somewiredisp.com/user/bla/$1 [L,R]
  </code></pre>
  
  <p>this is usually used if I register a domain for someone who needs a nice url for their forums or whatever. Works like a charm - the only "problem" would be that the address bar in the browser changes, but I've read that there would be no way to do that with external URLs, and since no one ever complained about it <em>I</em> am fine with it.</p>
  
  <p>However, now I would like to link some url to a subdirectory WITHOUT the url changing in  the address bar.</p>
  
  <p>domain2.com -> domain1.com/subdir (or domain2.com/subdir - that doesn't matter, since it's an alias domain).</p>
  
  <p>my current approach would be</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^(www\.)?domain2.com$ [NC]
  RewriteRule ^(.*) http://domain1.com/subdir/ [P]
  </code></pre>
  
  <p>which doesn't work (Error 404) - if I call domain1.com/subdir/ directly if works obviously.</p>
  
  <p>I also tried several variations of</p>
  
  <pre><code>RewriteRule ^(.*) http://domain2.com/subdir/ [P]
  RewriteRule ^(.*) /subdir/ [P]
  RewriteRule ^(.*) http://domain1.com/subdir/index.html [P]
  </code></pre>
  
  <p>all with the same result.</p>
  
  <p>maybe it's just a simple mistake but I am currently clueless :/</p>