Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6471419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:13:20+00:00 2026-05-25T06:13:20+00:00

I am using XAMPP, Apache 2.2.17. I have added virtual host but my virtual

  • 0

I am using XAMPP, Apache 2.2.17. I have added virtual host but my virtual host and localhost both point to the same location. Here is my code in httpd-vhosts.conf

<VirtualHost www.domain.tld:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot "C:/xampp/htdocs/workspace/testsite"
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot "C:/xampp/htdocs/xampp"
   ServerAlias localhost
   ServerName localhost
</VirtualHost>

With the above code, I get testsite with http://www.domain.tld so that is good. But If i type localhost, it will go to testsite as well. If I move ahead of test site then localhost goes to localhost good and http://www.domain.tld goes to localhost too. I tried different setting for localhost as like

<VirtualHost *>
<VirtualHost localhost:80>

and removing *.domain.tld from domain.tld but nothing works. Am I missing something obvious?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:13:20+00:00Added an answer on May 25, 2026 at 6:13 am

    My own answer: The following code fixed the problem

    <VirtualHost *:80> <--- * fixed the problem, apache 2.2 doc does say it must match www.domain.tld, which caused problem for other Virtual hosts
    ServerName www.domain.tld
    ServerAlias domain.tld 
    DocumentRoot "C:/xampp/htdocs/workspace/patriot2"
    </VirtualHost>
    
    <VirtualHost *:80>
       DocumentRoot "C:/xampp/htdocs/xampp"
       ServerAlias localhost
       ServerName localhost
    </VirtualHost>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in windows (using apache as server), my file path directory will be C:\xampp\htdocs\mysvn\PhpDocumentor\phpdoc.php. But
I have an Apache server installed on my windows machine using XAMPP. Now I'm
I using XAMPP and I have configure it in order to have virtual hosts
I have an apache server installed on my portable windows 7 machine using xampp
I have two virtual systems for development. First one is Windows + xampp (apache,
For learning purposes I have installed Joomla on my local host using XAMPP for
I am using xampp on Windows, but I would like to use something closer
I am using XAMPP on a localhost windows VISTA m/c...using gmail as smpt server
I am using XAMPP and was wondering if I can code my site to
I am trying to install Moodle 1.9 using XAMPP on a virtual machine running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.