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

I'm used to using MAMP for web development, and one of the things I can easily do is setup a new host for each project so that http://localhost/project1 can be accessed from http://project1.

How can I do the same on WAMP? Because my projects often have .htaccess rules set for URL rewriting or any paths that reference to the root, http://localhost/project1 blows up in WAMP for testing purposes.

share|improve this question
up vote 0 down vote accepted

You need to do two things for this to work.

  1. Set up a host name alias on your system. On pretty much any modern version of Windows, this is done through the file c:\windows\system32\drivers\etc\hosts. Find the line that starts with and append whatever hostname you like to it (multiple hostnames are separated by spaces). I'd suggest using something .local to make sure it doesn't clash with any registered DNS name. (.local isn't officially reserved, but I can't imagine it'll ever be a valid TLD.)

  2. Add a name-based virtual host to your Apache installation, using the name you created above. I'm pretty sure there's a tool included with WAMP to do this, but I don't recall the exact steps involved and don't have easy access to a WAMP installation right now.

When this is done, you should be able to access http://your-chosen-host-name.local.

share|improve this answer

You must log in to answer this question.

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