I don't believe I didn't know this all these years. You can edit windows host file at C:\windows\system32\drivers\etc\hosts, and add entries of the form:
127.0.0.1 foo.localhost
127.0.0.1 bar.localhost
Tip of the hat to wulff over at http://drupal.org/node/24454
hosts file
you can use it to "fake" any domain. for example
127.0.0.1 doubleclick.com
some people use this method to block advertisements from known ad servers.
it's also handy if you just changed dns settings on your domain, and you don't want to wait.
Drupal documentation
http://drupal.org/node/166831
http://drupal.org/node/32715
/etc/hosts on *nix
or edit the /etc/hosts file if you are cool enough to use *nix
I tend to use: 127.0.0.1
I tend to use:
127.0.0.1 dev prod domaintest newsiteThat's on OS X in /etc/hosts. Not sure if that syntax (all on one line) would work on Windows.
Yeah
I like to route 127.0.0.1 to example.com on localhost. That works too.
127.0.0.1 example.com
127.0.0.1 foo.example.com
Very handy when your code needs to test against the TLD string (.com|.net|.org).
- agentrickard
Text editor short cut
And did you know that if you create a short cut for your text editor, say by copying the existing one then editing its properties > target like this:
"C:\Program Files\PSPad editor\PSPad.exe" "C:\Windows\system32\drivers\etc\hosts"You can now edit your hosts file in seconds.
(note: SpyBot users, SpyBot locks the hosts file to prevent malicious editing by websites. To unlock it turn off under Tools > IE Tweaks by unticking the "Lock Hosts file read-only as protection against hijackers" box)