I use WAMP server on my Windows machine. I want to achieve the following setup:
1) I want to create multiple folders in my wamp's 'www' directory each representing a website.
2) Add multiple entries to my host file with different ip addresses, each pointing to one of the folders in the wamp's 'www' directory.
So lets say, I create 3 folders in my wamp 'www' directory named - "site1", "site2", "site3" and add the following to my host file:
127.0.0.1 site1.local
127.0.0.2 site2.local
127.0.0.3 site3.local
And then I goto the url "site1.local", I can get to the folder "site1" and the same for other two as well.
My knowledge:
I noticed that even if the host file is empty, going to any address in the format - "127.xx.xx.xx" where xx can be upto 99 and the last one not being 0 - will result in loading the default wamp page.
I know about setting virtual host servers in wamp through apache and addressing them to different directories.
My difficulty:
I tried many different ways but any address would only straight away point to the default directory that I set in apache as the main host. I think the host file is meant to be used to point all the addresses to the same point no matter what address we add to it. (But I'm not sure...)
Please help me achieve the aforesaid setup.