title: Apache VirtualHost and localhost
body: <p>I'm working with XAMPP on Mac OS X.</p>
  <p>I'm trying to run a <a href="https://en.wikipedia.org/wiki/Symfony" rel="noreferrer">Symfony</a> website properly for a client, and I really don't know Symfony (yet). I just want to install and launch it.</p>
  <p>I've changed my <em><a href="https://en.wikipedia.org/wiki/Hosts_(file)" rel="noreferrer">/etc/hosts</a></em> file this way:</p>
  <pre><code>127.0.0.1 www.mysite.local
  </code></pre>
  <p>And the <em>httpd.conf</em> file this way:</p>
  <pre class="lang-none prettyprint-override"><code>&lt;VirtualHost *:80&gt;
    ServerName www.mysite.local
    DocumentRoot /Applications/MAMP/htdocs/mysite/web
    DirectoryIndex index.php
    &lt;Directory /Applications/MAMP/htdocs/mysite/web&gt;
      AllowOverride All
      Allow from All
    &lt;/Directory&gt;
    Alias /sf /Applications/MAMP/htdocs/mysite/lib/vendor/symfony/data/web/sf
    &lt;Directory &quot;/Applications/MAMP/htdocs/mysite/lib/vendor/symfony/data/web/sf&quot;&gt;
      AllowOverride All
      Allow from All
    &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  <p>Now, the site is working (yay!), but I can't access any more any of my other local sites because <strong>localhost</strong> is rendered as <strong><a href="http://www.mysite.local" rel="noreferrer">www.mysite.local</a></strong>.</p>
  <p>Where am I wrong?</p>