Problem with Virtual Host and ServerName

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

Problem with Virtual Host and ServerName

Postby Castell » 23. August 2011 14:46

Hi there,

since i wanted to run two websites locally on my apache,
i added the virtual host directive to httpd.conf and added
also a line to the hosts file under the windows directory.

All went well, localhost led to one directoy, localhost2 to the other.

But the problem was, that whenever i used $_SERVER['SERVER_NAME']
in a php script, this always got dissolved into and that
ip led always just to one of the folders.

So in the other website, that wasnt targeted by,
i can't use $_SERVER['SERVER_NAME'] now.

What can i do?

Any help would be highly appreciated.

Posts: 1
Joined: 23. August 2011 14:01

Re: Problem with Virtual Host and ServerName

Postby JonB » 24. August 2011 13:56

Did you create one or two virtual hosts?
User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
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 48 guests