title: subdomain redirection in htaccess
body: <p>I was wondering if the following scenario is possible using htaccess rules.
  I want one subdomain to be redirected to another url.
  I have contact the server admin to add the "test" subdomain to "example.com" domain.
  The main domain has no other subdomains.</p>
  
  <p>What rule must i put in htaccess to do achieve:
  <a href="http://test.example.com" rel="noreferrer">http://test.example.com</a> to be redirected to <a href="http://www.something-else.com" rel="noreferrer">http://www.something-else.com</a>.</p>
  
  <p>NOTE: www.something-else.com is a complicated url (200 chars length)</p>
  
  <p><strong>EDIT</strong>
  My full htaccess file now looks like:</p>
  
  <pre><code>Options +FollowSymLinks
  RewriteEngine on
  RewriteOptions inherit
  RewriteBase /
  
  RewriteCond %{HTTP_HOST} ^test.example.com$ [NC]
  RewriteRule ^(.*)$ http://www.example.com/redir.php [L]
  
  RewriteCond %{HTTP_HOST} ^example.com [NC]
  RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  </code></pre>
  
  <p>The htaccess file is located to example.com root directory.
  I have no physical access to test subdirectory, although i know it exists - ping to that url shows me the IP of example.com</p>
  
  <p>Typing test.example.com to the browser's address bar has no effect. White screen, no redirection, no nothing. If some page exists there, i know not.</p>