Name-based virtual hosts in older ver. of XAMPP don't work

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Name-based virtual hosts in older ver. of XAMPP don't work

Postby thehawkman » 24. January 2013 19:39

So, i need to run several sites on my laptop (windows 8 ). I also need to run a PHP4 app. I'm not a programmer, so I can't rewrite it. What I am trying to do is create name based virtual hosts in XAMPP 1.4.2 the last version with PHP4. Except I can't get them to work properly.

My setup is like this:

NameVirtualHost *:80

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#<VirtualHost *>
# ServerAdmin
# DocumentRoot /www/docs/
# ServerName
# ErrorLog logs/
# CustomLog logs/ common

# Win32DisableAcceptEx ON

<VirtualHost *>
DocumentRoot c:/xampp/htdocs
ServerName localhost
<VirtualHost yata4>
DocumentRoot c:/xampp/sites/yata4
ServerName yata4

the problem is now that I added the yata4 virtual host, its contents also gets displayed when typing http://localhost in the address bar.
In case I wasn't clear, if I type in http://yata4 i get the contents of that domain, and if I type in http://localhost I again get the contents of the yata4 subdomain (I checked). This isn't what I expect, (what I had in mind was http://localhost would take to me to xampp/splash.php and typing yata4 would get me the contents of that virtual host. I can't see any issue with my config that would prevent it from working it the way I want it, but something is not working.
Posts: 1
Joined: 24. January 2013 19:25
XAMPP Version: 1.7.1
Operating System: Windows 8

Re: Name-based virtual hosts in older ver. of XAMPP don't wo

Postby JonB » 29. January 2013 04:53

Code: Select all
<VirtualHost yata4>


Code: Select all
<VirtualHost *>

You probably also need a hosts entry. yata4

Good Luck
User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-3
Operating System: Windows XP/7 - Fedora 15 1.7.7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 39 guests