Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Xampp for a dev server on Windows 7.

my windows 7 hosts file @ (C:\Windows\System32\drivers\etc\hosts) has this... localhost

My Apache http-vhosts.conf (E:\Server\apache\conf\extra\http-vhosts.conf)

file has this...

<VirtualHost *:80>
DocumentRoot "E:/Server/htdocs/myframework"

<VirtualHost *:80>
DocumentRoot "E:/Server/htdocs/"
ServerName localhost
ServerAlias localhost

Now my problem is when I go to,, or localhost in the browser, it ALWAYS loads the files from E:/Server/htdocs/myframework so the real problem is when I go to localhost it should load files from E:/Server/htdocs/ instead of from E:/Server/htdocs/myframework

I am at a loss here, can someone please help me with this issue?

share|improve this question
up vote 1 down vote accepted

Seems like you're missing a NameVirtualHost directive, forcing all requests to be serviced by the first listener on that port to load.

Look around for it in the config - you'll want NameVirtualHost *:80, if it's not there.

share|improve this answer
This NameVirtualHost should be in the same file as my virtualhost listed above? – JasonDavis Aug 17 '11 at 1:37
I got it now I added it above the virtualhosts and all is working, thank you I would of never figured that out – JasonDavis Aug 17 '11 at 1:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.