Hi I configured two virtual hosts in my XAMPP for windows environment. This is what I did:
1) I edited hosts file and added the following.
127.0.0.1 localhost
127.0.0.1 www.maria.com
127.0.0.1 www.mary.com
::1 localhost
2) I edited httpd-vhosts.conf file and added the following:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.maria.com
DocumentRoot "C:/xampp/htdocs/maria"
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</VirtualHost>
<VirtualHost *:80>
ServerName www.mary.com
DocumentRoot "C:/xampp/htdocs/mary"
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</VirtualHost>
3) This is my problem:
when I type http://www.mary.com/index.html or http://www.mariah.com/index.html, I see the contents of index.html in browser.
a) If I type http://localhost, I get the error message as follows:
Object not found, Error 404.
I also noticed that the URL changes to http://localhost/xampp.
Before I added virtual hosts, when I type http://localhost, I used to see my index.html displayed in browser.
Did I do something wrong when I configured virtual hosts?
b) Virtual hosts works ok, but I do not understand why I have to type full URL http://www.mary.com/index.html instead of http://www.mary.com.
Did I do something wrong with the set up?
I appreciate your help. I am also adding the part of httpd.conf file which you may be interested to see:
------------ Part of httpd.conf ---------------------
ServerAdmin admin@localhost
ServerName localhost:80
DocumentRoot "C:/xampp/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</IfModule>
------------------------------------------------------------------------------------
I sincerely appreciate your help.
Thank You.
Srini
[/code]