title: Redirect all subdomains to file
body: <p>I have a server to which many domains points. So I need a generic .htaccess rule. I need to create a .htaccess file which redirects all subdomains to their correspondent subdomain folder.
  Is that possible? Thanks.</p>
  
  <p>For example:</p>
  
  <p><code>http(s)://apple.domain1.com -&gt; https://domain1.com/redir/apple/index..html</code></p>
  
  <p><code>http(s)://orange.2domain.co.uk -&gt; https://2domain.co.uk/redir/orange/index.asp</code></p>
  
  <p><code>http(s)://banana.doma3n.org -&gt; https://doma3n.org/redir/banana/index.php</code></p>