I seem to be having a bit of trouble with virtual hosts in Apache.
I have added 127.0.0.1 www.mysite.com to my hosts file in Windows and I see my web server fine.
I then added the below to my conf file, as the very end, I don't know if it matters where it goes!
NameVirtualHost * <VirtualHost *> ServerName unknown DocumentRoot "C:/xampplite/htdocs" </VirtualHost> <VirtualHost www.mysite.com> ServerName www.mysite.com DocumentRoot "C:/xampplite/htdocs/mysite" </VirtualHost>
So what I am trying to achieve is going to www.mysite.com will bring up /mysite folder and anything else - or just going to 127.0.0.1 will default back to the main htdocs folder.
But it doesn't.
It all ends up going to the mysite folder.
Looking at the error log this occurs on start up:
[Tue Sep 13 19:45:08 2011] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
For the record I listen to ports 80 and as lame as it is, 1337.