windows 7 Hosts file...

127.0.0.1       www.test.com

httpd-vhosts file... MY-IP-IS-HERE is my actual IP...

NameVirtualHost MY-IP-IS-HERE

<VirtualHost MY-IP-IS-HERE>
 ServerName test.com
 DocumentRoot "E:/Web Server/xampp/htdocs/test/ajaxblog"
 DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>

For some reason, when I go to test.com or www.test.com it loads E:/Web Server/xampp/htdocs/ instead of loading E:/Web Server/xampp/htdocs/test/ajaxblog and I cannot figure out how to get virtual host to load anything deeper then my root directory. Am I doing something wrong? I am using Apache or Xampp on Windows 7

link|improve this question

74% accept rate
What does your error/access log say ? – Iain Jan 31 '11 at 12:18
feedback

2 Answers

www.test.com doesn't work because you don't have a ServerAlias setup for www.test.com

link|improve this answer
hello I have added ServerAlias www.test.com but it still loads my root directory instead of root/test/ajaxblog any ideas? – jasondavis Jan 31 '11 at 11:17
You have quotes around your document root; Try removing them... – Jacob Jan 31 '11 at 11:53
3  
You need the quotes as you have spaces in your path. I don't think it is that. – dunxd Jan 31 '11 at 12:25
Wasn't paying attention, your correct. – Jacob Jan 31 '11 at 12:28
feedback

In addition to Jacobs answer on adding a ServerAlias www.test.com, you should restart Apache to make the change take effect. Make sure that you have not double ServerName test.com entries in your virtualhost configuration.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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