title: multiple rewrite for a single url using htaccess
body: <p>I have a multi blog website in which there are multiple domains.
  The thing is i need a rewrite rule for the following syntax</p>
  
  <pre><code>XXX.domain.com/{any other things} to www.domain.com/domain/XXX/{any other things}
  </code></pre>
  
  <p>Also i had written a set of rules for the below one too</p>
  
  <pre><code>^domain/([a-zA-Z0-9]+)/cat/([a-zA-Z0-9]+)$ index.php?domain=$1&amp;cat=$2
  </code></pre>
  
  <p>So the things is i need to construct a rule which converts domain to path then again process the other things as follows with that.</p>