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

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

127.0.0.1 www.testing.com testing.com localhost

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

file has this...

<VirtualHost *:80>
DocumentRoot "E:/Server/htdocs/myframework"
ServerName testing.com
ServerAlias www.testing.com
</VirtualHost>

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

Now my problem is when I go to testing.com, www.testing.com, 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?

link|improve this question

74% accept rate
feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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