.htaccess redirect domain to subdirectory without changing URL
You can use this rule:
RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.com$ [NC]
RewriteRule !^subdir/ /subdir%{REQUEST_URI} [L,NC]
This will prefix every request for domain2.com
with /subdir
if it is not already there.