I am installing XAMPP 1.7.3 on Windows XP SP3. When I type in http://localhost, I am redirected to http://localhost/xampp. Everything looks fine in http://localhost/xampp.
The result I am trying to get is to enable www.example.com to redirect to localhost. So that when I type in www.example.com/xampp I am directed to the xampp setup page. Or if I type www.example.com/store I am directed to my store website residing in /htdocs.
To do this I edited C:\WINDOWS\system32\drivers\etc\hosts with the following info:
127.0.0.1 localhost
::1 localhost
127.0.0.1 www.example.com
::1 www.example.com
127.0.0.1 mail.example.com
::1 mail.example.com
127.0.0.1 example.com
::1 example.com
However when I type in www.example.com I get:
You have reached this web page by typing "example.com", "example.net", or "example.org" into your web browser.
These domain names are reserved for use in documentation and are not available for registration. See RFC 2606, Section 3.
When I type www.example.com/xampp/ I get:
Not Found
The requested URL /xampp/ was not found on this server.
_______________________________________
Apache/2.2.3 (CentOS) Server at http://www.example.com Port 80
I read in several forums I need to edit my C:\xampp\apache\conf\extra\httpd-vhosts.conf. The following is what I entered in this file:
NameVirtualHost *:80
<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host2.localhost
ServerName localhost
DocumentRoot "C:\xampp\htdocs"
##ServerAlias http://www.dummy-host2.localhost
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host2.localhost
ServerName www.example.com
DocumentRoot "C:\xampp\htdocs\store"
##ServerAlias http://www.dummy-host2.localhost
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
<Directory "C:\xampp\htdocs\store">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
After making the changes to the httpd-vhosts.conf file, the results were the same as if I had not edited the file.
I have rebooted Windows multiple times and restarted Apache after each file change, but alas the results are all the same as described above. What am I missing to get www.example.com to work?