Eduard Luca
Eduard Luca

Reputation: 6611

How to add subdomain on local machine

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>

Upvotes: 1

Views: 821

Answers (1)

Uday Sawant
Uday Sawant

Reputation: 5798

try to change the port number like this

<VirtualHost 127.0.0.1:8080>
    ServerPath /demo-example/
    ServerName demo.example.com
</VirtualHost>

Upvotes: 1

Related Questions