title: Redirect subdomain to domain and keep everything after the URL
body: <p>I need redirect my subdomain </p>
  
  <blockquote>
    <p><a href="http://sub.domain.com" rel="nofollow">http://sub.domain.com</a> </p>
  </blockquote>
  
  <p>to </p>
  
  <blockquote>
    <p><a href="http://domainB.com/news" rel="nofollow">http://domainB.com/news</a> </p>
  </blockquote>
  
  <p>I'm tested various posibilities in htaccess without any result.</p>
  
  <p>This code works fine, but rediret from domain, not from subdomain...</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^domain.com$ 
  RewriteRule ^(.*) https://subdomain.domainB.com/$1 [P]
  </code></pre>
  
  <p>This code redirect domain.com to </p>
  
  <blockquote>
    <p><a href="https://subdomain.domainB.com" rel="nofollow">https://subdomain.domainB.com</a> </p>
  </blockquote>
  
  <p>and preserve domain.com in address bar and works correctly. I want subdomain to subdomainB.</p>
  
  <p>I need help, please.</p>
  
  <p>Thanks in advance ;)</p>