Question

I have modified my etc/hosts file (under Windows 7), so that www.example.com and demo.example.com both point at localhost. Unfortunately accessing demo.example.com, takes me to localhost's document root (which is logical). I want to change this to point demo.example.com to demo.localhost, so make a new virtual subdomain on localhost and then the etc/hosts file should do it's work.

Could anyone point me in the right direction? I have this vhosts file, which has a valid syntax, but doesn't seem to be working as I want.

<VirtualHost 127.0.0.1:80>
ServerPath /demo-example/
ServerName demo.example.com
</VirtualHost>
Was it helpful?

Solution

try to change the port number like this

<VirtualHost 127.0.0.1:8080>
    ServerPath /demo-example/
    ServerName demo.example.com
</VirtualHost>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top