-1

my windows 7 hosts file has this...

127.0.0.1     www.testing.com
127.0.0.1    testing.com

and my apache http-vhosts.conf file has this...

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

It almost works as I want it except it is wrong.
Now when I go to "testing.com" or "www.testing.com" it does load the "E:/Server/htdocs/myframework" page as I want it to, however now when I got to "localhost" it always loads "E:/Server/htdocs/myframework" instead of localhost/the-directory-i-want or file i want

Anybody know why or better, how I can make it work how I would expect it?

JasonDavis
  • 2,658
  • 6
  • 25
  • 32

1 Answers1

3

If you only have that one vhost set up then it will serve eveything. You could set up a localhost vhost

<VirtualHost *:80>
    DocumentRoot "E:/Path/To/localhost"
    ServerName localhost
    ...
</VirtualHost>

Also Your hosts file can have the hosts all on one line

127.0.0.1 www.testing.com testing.com localhost
user9517
  • 114,104
  • 20
  • 206
  • 289
  • thanks for the response and the tip on the 1 line for hosts,however, I have tried this and it still routes everything E:/Server/htdocs/myframework instead of E:/Server/htdocs/ ... any other ideas? And yes I restarted Apache, thanks again – JasonDavis Aug 11 '11 at 21:23