Wildcards in a Windows hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local, site2.local etc, and have them all resolve to localhost, while Apache serves a different site accordingly.

I am on Windows XP.

I tried adding

127.0.0.1       *.local

to my c:\windows\system32\drivers\etc\hosts file, also tried:

127.0.0.1       .local

Neither of which seem to work.

I know I can set them up on different port numbers, but that is a pain since it is hard to remember which port is which.

I don’t want to have to setup a local DNS server or anything hard, any suggestions?

20 Answers
20

Leave a Comment