I develop websites and use WAMP as my testing server. it resides on the same computer that I do my development on.
I don't want to register with any DNS server etc.
I read that you can run multiple websites in Apache by editing the hosts file in Windows and adding virtualhosts to httpd.conf
Here is my hosts file:
127.0.0.1 localhost
127.0.0.1 test1
127.0.0.1 test2
127.0.0.1 test3
Here is the bottom of my httpd.conf file:
NameVirtualHost *:80
<VirtualHost *>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>
<VirtualHost *>
ServerName test1
DocumentRoot "C:/wamp/www/mollio"
</VirtualHost>
etc.
So, in theory I should be taken to the "C:/wamp/www/mollio" directory if I access [
test1] from the same computer that the server is on.
However, it shows me this directory instead: "C:/wamp/www"
If I move the test1 virtualhost above the localhost virtualhost in the httpd.conf file, that directory is displayed instead. It is displayed no matter what address I use, [
localhost] or [
test1]
Why isn't this working?