How and why to develop website in a new server while old website is still live at old hosting until the new website is ready
Customers often want us develop new website to their domain name customer.com but until the new website is finalized, tested and the content added, the old website should still be live.
I’m going to explain the easiest way to do so without extra time (=cost for customer) spent on transferring new website to another hosting server and also configuring more complex web solutions to work properly in different server with different settings once it’s ready. Of course it’s also possible to develop your new website at existing hosting server’s subdirectory customer.com/new-website but that has some minuses, too:
- It takes some extra time to make the website work later in root directory (and can be much more time consuming if customer’s hosting company doesn’t offer shell access as most of them do if you don’t have dedicated hosting).
- Downtime of the website while taking the old web down and setting the new one up in the right location is in progress.
So, here comes the best solution – create new hosting in a new server for customer.com – of course now you don’t see the new website before DNS entries are changed and customer.com is not pointed to your new websites hosting from domain registration control panel (from the place where the domain name was registered). So now there are two hosting servers set up to host customer.com but everybody still sees what’s in the old hosting server = old website because if you type customer.com into your browser it turns to DNS and the DNS tells the browser that this domain should be looked up from the old server’s IP address. Now you as a developer (and customer as the one who want’s to see the development and add content before new website goes live) need to tell your computer NOT to look from internet in which server (IP) customer.com is hosted but to open customer.com from the new server (for example e-Stonia main server’s IP is 92.63.140.173).

How to tell your Mac OS to look for customer.com from 92.63.140.173:
- Open terminal: from “Finder” take “Applications” -> “Utilities” -> “Terminal”
- Type into terminal:
- sudo nano /private/etc/hosts (you will be asked for administrator’s password – type it in)
- Add one more line at the bottom of the file:
- 92.63.140.173 customer.com
- Hold down control key and push letter o key to save the file. Now press enter on the filename prompt and hold down control key and push key x to exit the editor.
- Type:
- dscacheutil -flushcache
- Close terminal window, close your browser, re-open it and type in customer.com and you should see new website that is in development.
How to do it on Windows XP:
- Open from Start menu “Programs” -> “Accessories” Notepad and take from “File” menu “Open”
- Go to folder “My Computer” -> “C:” -> “WINDOWS” -> “System32″ -> “drivers” -> “etc”
- From “Files of Type” drop-down choose “All files”
- Open file “hosts” and add one more line at the bottom of the file:
- 92.63.140.173 customer.com
- Close your browser, re-open it and type in customer.com and you should see the new website that is in development.
With Windows Vista and Windows 7 just click Start – search for “Notepad“, right-click on it and select “Run as Administrator“.
When web development is done and the new website is ready, customer.com will be pointed to the new hosting name servers from domain registration control panel and everybody will start seeing new website when they type customer.com into their browser.
Best word to describe Jonathan - is creativity. Jonathan comes up with great marketing strategies and creative solutions to make them happen.
Runo's a great coordinator. He can foresee all the strengths and weaknesses of a project making everything run smoothly from the beginning.
Kaspar knows how things work and how to make them work. He knows how to get the most out of modern technology and internet.

Manuel
22 Mar, 2010
And what to do next on Windows 7 after I have opened the Notepad as administrator?
Kaspar
23 Mar, 2010
Just take from “File” menu “Open” and open the hosts file from “C:” -> “WINDOWS” -> “System32″ -> “drivers” -> “etc”
And do all the same as in Windows XP instructions.
Vicky
13 May, 2010
Hi-ya,
I have tried this with a wordpress implementation and it works for the homepage but I get 404 page error for any sub-level pages.
Any ideas?
Thanks,
Vicky.
Vicky
13 May, 2010
…just worked it out…I was using permalinks in WordPress and so needed the mod_rewrite script in place.
Dmitry
19 Oct, 2010
for Ubuntu 10.04 worked:
sudo nano /etc/hosts
after adding a line just press CTRL+O which means WriteOut
and press enter, then try )