title: Subdomain on localhost
body: <p>I would like to create a registration form which creates subdomains (yet on localhost), but I have got some problem. I know how to create subdomains, writing for example these in vhosts:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@dummy-host.hleclerc-PC.ingenidev
      DocumentRoot "C:/wamp/www/something/"
      ServerName localhost
      ServerAlias something.localhost
      ErrorLog "logs/error.log"
      CustomLog "logs/access.log" common
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>And put this line in hosts:</p>
  
  <pre><code>127.0.0.0              something.localhost
  </code></pre>
  
  <p>It's working, but what I want is that when I register a new subdomain (for example: other), then when I try to open other.localhost, then it opens the specified folder (../www/other/).
  I tried it in vhosts with "ServerName *.localhost", "ServerName localhost", "ServerAlias *.localhost", "ServerAlias localhost", and in hosts "127.0.0.1 *.localhost" with all of the permutation of these, but neither of these worked for me.
  I have thinked about it, that on registration I put a new block in vhosts, with the optimal data, but I don't think it's very safe/feasible/or the best way to do.</p>
  
  <p>Hope someone can help me!</p>
  
  <p>Thanks in advance!</p>