title: Wordpress site broken after Apache vhost setting
body: <p>I had a working wordpress site accessible by <a href="http://localhost/wp" rel="nofollow">http://localhost/wp</a> corresponding to the directory /Library/WebServers/Documents/wp. Since I desired to have my wordpress site accessible by <a href="http://wordpress" rel="nofollow">http://wordpress</a> without moving the wordpress directory I decided to set a new host in /etc/private/hosts where I added the entry:</p>
  
  <pre><code>127.0.0.1   wordpress
  </code></pre>
  
  <p>Then I was able to access the site with <a href="http://wordpress/wp" rel="nofollow">http://wordpress/wp</a>. To avoid the 'wp' part of the URL I decided to use Apache virtual hosts by adding in /etc/apache2/extra/httpd-vhosts.conf the following block:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot "/Library/WebServer/Documents/wp"
      ServerName wordpress
      ServerAlias wordpress
      ErrorLog "/private/var/log/apache2/wordpress"
      CustomLog "/private/var/log/apache2/wordpress" common
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Then I restarted Apache and trying to access the site by using the URL <a href="http://wordpress" rel="nofollow">http://wordpress</a> I was able to see the written part of the first page but <strong>no images</strong> and all the <strong>links where broken</strong>.
  Checking out the links I see that the URL they are pointing still contains the 'wp' part I was trying to avoid.
  Any suggestion?</p>