1

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.

1 Answer 1

0

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.

You must log in to answer this question.

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