Adding the snippet below to an .htaccess file will redirect any requests from domain1.com/* to domain2.com/subdir/*

RewriteEngine on

# perform redirect if http://domain1.com
RewriteCond %{HTTP_HOST} ^http://domain1.com [NC]  
RewriteRule ^(.*)$ http://domain2.com/subdir/$1 [R=301,L]