Q: redirect specific subdomain for many domains to single domain We are trying to redirect many domains but a specific subdomain to a single domain, all the domains doc root are within one folder so using the .htaccess in that root folder should be recursive for all domains, example
/home/user/public_html/.htaccess

/home/user/public_html/domain1/
/home/user/public_html/domain2/
/home/user/public_html/domain3/

We want to redirect mail.* to https://server.domain.com:2096/
RewriteEngine On
RewriteRule ^mail(.*)$ https://server.domain.com:2096/ [R=301]

Assuming it needs to be more complex but unable to find anything similar when using a wildcard for the domain itself

A: You need to use RewriteCond %{HTTP_HOST} to match domain names:
RewriteEngine On

RewriteCond %{HTTP_HOST} ^mail [NC]
RewriteRule ^ https://server.domain.com:2096%{REQUEST_URI} [R=301,L,NE]

