My current (old) website is just a static site. It has been online for 6 years. I just rebuilt it on Drupal. I need to obviously replace the current website with the old one. But first, the new site will be on a different server than my old one. I need to configure the dev environments and production environments on the new server, so while I do that, the current (old) site still has to be accessible to the public. So how do you go about this? How do I have the current old site still accessible, while the new site is being configured on the new server. If my domain is abccompany.com on the current site, how do I at the same time configure the new site on the new server that has the same address?

2 Answers 2


Deploy New Site at Temporary Address

If you have the option to create a different virtual host on the existing server, you can create a virtual host named "abccompany.com.staging" (though you may need to modify the application's configuration to respond under this hostname).

If you do not have the option to create a different virtual host but you do have the option to change how the web server behaves based upon a visitor's IP address, you could configure your server to host a different version of the site when visited from your IP address.

Easiest option: if you do not have access to make the necessary changes to the server's configuration (or you simply do not want to) you can set the site up on a different server under the "abccompany.com" hostname.

Assuming that the hostname has changed or the new version of the site is being served on an IP which does not have a public A/AAAA record associated with it, change your hosts file to reflect the IP associated with the site and flush your local DNS cache so your web browser will request the specified hostname from the IP you set.

The nice thing about using DNS to control access to the new version of the site is that you do not need to take any special measures to hide the new version from normal visitors or search engines - they simply will not request the domain from a server which is not associated with the domain's forward DNS.


Before transitioning, you should determine whether any of the existing site's URL's will need to be redirected in the new version of the site to prevent link rot in search engines' indexes and other sites' links to your site.

Create and test redirects on your site. You may want to implement these redirects in your webserver's configuration, however, if you're comfortable with PHP then a 404 handler script (like this one) might be easier to implement (with the added benefit of lower overhead for request processing once search engines update their indexes).


Once you have tested the new version of the site and determined that it is ready to go live, update abccompany.com's DNS records (if you are using a different server) or your server's configuration (if you are using a made-up hostname or you elected to modify your server's configuration) to direct visitor's to the new version of the site.

Note: You can modify the TTL value for your A/AAAA records before making this switch to reduce the length of time that visitors' queries for your site will return the old server's IP address if you're switching servers, however, some ISP's will ignore TTL values so the only guaranteed method for an immediate transition would be to implement the new version of the site on the same server which hosts the old version (otherwise visitors who are still relying upon their cached DNS records will be directed to the old site until the cache lifetime expires).


I would recommend that you create a sub-domain for the new site for testing. So if your current domain is www.domain.com, then create a test.domain.com entry at your DNS provider pointed to the new server's IP address. This allows you time to test the new server while the old server is functioning as usual. One small point, for the test domain I'd recommend putting in a robots.txt file with the following content:

User-agent: *
Disallow: /

This makes sure Google and other major search engines do not start indexing the test domain. Search engines might not find the test domain for a while, but I prefer to be safe than sorry when it comes to SEO matters.

When your testing is complete, you can point your existing domain to the new server. You will want to wait a for a while for the DNS entry to transition. At a minimum it might take 2 or 3 days for the new IP address to propagate across the internet. So content from both sites would be served during the transition period. If this is not acceptable, then I'm not sure how you would approach the transition. You'll want to delete your test domain DNS entry as well.

Make sure to clear out the contents of the robots.txt file after the existing domain is pointed to the new server. This is important, you don't want the search engines to stop crawling your site.

I hope this helps and makes sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.