I have recently setup a virtual host on my local web server (per this question, Config problem with Apache 2 on Win 7).

I'm using Apache 2.2 on Win 7, as part of Zend Server.

At the moment, the root of my application's directory is accessible via either the virtual host (http://openco.local), or the local host name (http://localhost). How do I change this so that openco.local continues as is, but localhost points to it's original location (i.e. htdocs)?

Any assistance appreciated!

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

You should add another virtual host definition before the one for openco.local, as in:

<VirtualHost *:80>
   ServerName localhost
   DocumentRoot /var/www/htdocs
</VirtualHost>

That way open.local ceases to be the default virtual host.

link|improve this answer
Thanks Eduardo I, nice one. – Kim Apr 16 '11 at 23:08
feedback

Your Answer

 
or
required, but never shown

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