Please create a new .htaccess file in your site root folder and place the below code in it:
RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteCond %{REQUEST_URI} !^/subdirectory/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /subdirectory/$1 RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteRule ^(/)?$ subdirectory[L]
Please make sure that you substitute example.com for your primary domain and subdirectory for the subdirectory to which you are redirecting the domain.