title: Dynamic subdomains using .htaccess
body: <p>I am developing a multi-vendor shopping cart website in Magento. Currently I have separate url for each vendor like below</p>
  
  <pre><code>http://mydomain.com/vendor1
  http://mydomain.com/vendor2
  </code></pre>
  
  <p>I want to change the above URLs like below</p>
  
  <pre><code>http://vendor1.mydomain.com/
  http://vendor2.mydomain.com/
  </code></pre>
  
  <p>How can I change the URL structure like this using htaccess ?</p>
  
  <p>Any assistance appreciated.</p>