Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok, I have added lines like:

Or some other domain that points to my routers IP, and is forwarded, but I get to the main site, but I want it to go to the subfolder I defined in my httpd-vhosts.conf:


 DocumentRoot "D:/Apps/xampp/htdocs/somedomain"

So, locally works, just remotely it goes to the root htdocs. So If I use a *:80 wildcard I works, but then everything points to the subfolder and all the other vhosts seem to get ignored.

Any Idea why this is?

share|improve this question is not going to work for any external connections as it is just local address which each host has it assigned to itself.

I would suggest to change httpd.conf so, apache process listens on your IP address assigned by DHCP

share|improve this answer
^ Also, a hosts file only works locally. An external machine won't be able to use anothers hosts file. – cutrightjm Apr 12 '12 at 16:47
So, I'll leave the hosts file alone, I just followed some instructions somewhere to get vhosts to work on Xampp apache server.. – TrySpace Apr 13 '12 at 15:33
Wait, m1k3y02, are you saying I have to put the <virtualhost> stuff in httpd.conf instead of the httpd-vhosts.conf? – TrySpace Apr 13 '12 at 15:39
no, what I was trying to say is, that wherever you have IP address declaration it should be changed to IP address other than as it is just loop back. So, it is the same like you would access localhost - it won't work from external/remote machine, which in your case is your host. localhost/ each time references to the machine you operating at. i.e. ping localhost will ping the computer where you executed command. do ipconfig or ifconfig -a from command line and take the IP other than and replace it in httpd.conf – m1k3y02 Apr 13 '12 at 15:49
Ok, turns out, yes, I used the wrong config all along, It was a combination of using the hosts file at the same time. – TrySpace Apr 13 '12 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .