E-commerce & Internet Marketing Blog: Tips and tricks in internet marketing. Latest trends in web design.

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:

  1. 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).
  2. 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).

Web design at new hosting

How to tell your Mac OS to look for customer.com from 92.63.140.173:

  1. Open terminal: from “Finder” take “Applications” -> “Utilities” -> “Terminal”
  2. Type into terminal:
    • sudo nano /private/etc/hosts (you will be asked for administrator’s password – type it in)
  3. Add one more line at the bottom of the file:
    • 92.63.140.173 customer.com
  4. 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.
  5. Type:
  6. dscacheutil -flushcache
  7. 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:

  1. Open from Start menu “Programs” -> “Accessories” Notepad and take from “File” menu “Open”
  2. Go to folder “My Computer” -> “C:” -> “WINDOWS” -> “System32″ -> “drivers” -> “etc”
  3. From “Files of Type” drop-down choose “All files”
  4. Open file “hosts” and add one more line at the bottom of the file:
    • 92.63.140.173 customer.com
  5. 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.

  • And what to do next on Windows 7 after I have opened the Notepad as administrator?

  • 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.

  • 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.

  • …just worked it out…I was using permalinks in WordPress and so needed the mod_rewrite script in place.

  • 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 )

  • Have you ever thought about creating an e-book or guest authoring on other sites?
    I have a blog centered on the same ideas you discuss
    and would love to have you share some stories/information. I know my
    visitors would enjoy your work. If you are even remotely interested, feel
    free to send me an e-mail.

You can follow any responses to this entry through the RSS 2.0 feed.