Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Hi Everyone
So I have xampp running, localhost or will take me to htdocs within my xampp folder. Is there a way I can use a similar name such as localhost2 on the same machine to take me to folder, lets say its called localhost2, within htdocs.

The reason I am asking this is because I think I have some redirect issues. I am trying use bromine and apparently it only works needs to be at the root; however, I have other things in root, and I know there will be issues with rewrite + cake + normal folders. So i guess my work around (other than trying to fix the main rewrite issue) is to try to create a shortcut, or subdomain or something to folder I am trying to get to.

I am sure there is a better word for all of this, but I am no server admin! I hope that makes sense. Thanks!

share|improve this question
up vote 3 down vote accepted

XAMPP uses Apache, right?

Yes, it's possible.

There's two things you'd need to do:

  1. Add "localhost2" to the /etc/hosts entry for localhost (if it's not there, simply add " localhost localhost2"). I'm assuming Unix of some sort. If it's Windows there's ways to do the same thing.
  2. Add a virtualhost for localhost2 to the apache configuration (pointed at the other directory).
share|improve this answer
Yep. Normal virtual hosting will make the website work, and when you're doing something local (to the machine you're using) or temporary and don't need DNS, you can just add entries to the /etc/hosts file. Note that you can also use something like: echo >> /etc/hosts " localhost2", if you need a seperate IP from localhost. You might need it, for instance, if you're testing SSL. – Lee B Oct 27 '09 at 21:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.