Rewritecond %{http_host} ^xxxx.com [nc]

RewriteRule ^(.*)?$ https://www.xxxx.com/$1 [R=301,L]

RewriteCond %{SERVER_PORT} !^443$

RewriteRule ^(.*)?$ https://www.xxxx.com/$1 [R=301,L]
Redirect 301 /mip/ https://mip.xxxx.com/