Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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 127.0.0.1 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

Your Answer

 
discard

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.