title: WAMP relative urls looking in subfolders, virtual hosts setup issue?
body: <p>first post on stackoverflow!</p>
  
  <p>Been at this for hours and can't figure it out.</p>
  
  <p>Wamp is installed to C:\wamp, website is in C:\wamp\www\groovysite.net and displays in my browser at localhost/groovysite.net.</p>
  
  <p>There is a subfolder groovysite.net/subfolder. The problem is that all relative urls in pages contained in the subfolder are adding the subfolder into the url path just after the root folder.</p>
  
  <p>For example two stylesheets live in</p>
  
  <pre><code>C:/wamp/www/groovysite.net/stylesheets/app.css
  C:/wamp/www/groovysite.net/style.css
  </code></pre>
  
  <p>In my site's head is</p>
  
  <pre><code>&lt;link rel="stylesheet" href="stylesheets/app.css" /&gt;
  &lt;link rel="stylesheet" href="style.css"&gt;
  </code></pre>
  
  <p>On the hompepage groovysite.net/index.html the url paths are</p>
  
  <pre><code>localhost/groovysite.net/stylesheets/app.css
  localhost/groovysite.net/style.css
  </code></pre>
  
  <p>so they work. But on subfolder/page.html the paths are</p>
  
  <pre><code>localhost/groovysite.net/subfolder/stylesheets/app.css
  localhost/groovysite.net/subfolder/style.css
  </code></pre>
  
  <p>so it seems like WAMP is sticking the subfolder path onto the relative urls.</p>
  
  <p>I read that setting up virtual hosts directs WAMP to find the correct document root for each virtual host and that would sort this issue out. To that end this is my current configuration on apache 2.4.9:</p>
  
  <p>Hosts file:</p>
  
  <pre><code>127.0.0.1 localhost
  ::1  localhost
  
  127.0.0.1 groovysite.net
  ::1  groovysite.net
  </code></pre>
  
  <p>httpd.conf virtual hosts line is uncommented</p>
  
  <p>httpd-vhosts.conf</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot "c:/wamp/www"
      ServerName localhost
      ServerAlias localhost
      ErrorLog "logs/localhost-error.log"
      CustomLog "logs/localhost-access.log" common
      &lt;Directory  "c:/wamp/www"&gt;
          AllowOverride All
          Options Indexes FollowSymLinks
          Require local
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
      DocumentRoot "c:\wamp\www\groovysite.net"
      ServerName groovysite.net
      ServerAlias www.groovysite.net
      ErrorLog "logs/groovysite.net-error.log"
      CustomLog "logs/groovysite.net-access.log" common
      &lt;Directory  "c:/wamp/www/groovysite.net"&gt;
          AllowOverride All
          Options Indexes FollowSymLinks
          Require local
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Code was taken from RiggsFolly's answer <a href="https://stackoverflow.com/a/26116974/4341381">here</a>.</p>
  
  <p>Completely stumped...any help would be greatly appreciated!</p>