Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im wanting to set up my local xampp server in a particular way. For each individual project i create in my document root, i want to be able to access it via http://projectname.localhost. How do i go about doing this with virtual hosts. Do i need to edit windows host file for every new project i create?

share|improve this question

Yes, you will need to edit the windows host file for every new project. The windows host file does not allow wildcard subdomains. If it is very important to you, you can run your own DNS server and setup TCP/IP to use for DNS.

You can use mod_vhost_alias to configure the virtual host in Apache dynamically. Something like...

  ServerAlias *.localhost
  UseCanonicalName Off    
  VirtualDocumentRoot C:/xampp/htdocs/%1
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .