Great tip for Windows 7 users.
This is one of those life-changing, super-awesome tips that I wish I had known about years ago. Note that this only works on Windows, and I’ve only tested it on Windows 7.
Here’s the scenario: you’ve got a client who has a website up and running on their domain name, http://www.mysite.com. You are creating a new WordPress site for them, but their old site needs to stay up until the very last minute. It would be great to be able to get their whole WordPress site installed and ready to go on a live server (i.e. not your localhost on your computer), and switch the domain’s DNS and voila – the new site replaces the old site almost immediately.
But you can’t really install and work with WordPress on a server that doesn’t have a domain name pointed at it. So here’s how you can fake this by making your computer think that the new site installation should be displayed as http://www.mysite.com:
- Install WordPress on the new server via Fantastico, Quick Install, or something like that.
- Find the following file in Windows: ?C:WindowsSystem32driversetchosts. Open hosts in Notepad or another text editor.
- Save the file. Now visit mysite.com in your browser, and you’ll see your new WordPress installation.
Hat tip to Mark Kaplun for this amazing trick.