How to update a website without showing 'under construction' or down time

Ok so you might have noticed we've had a bit of an overhaul. Actually, behind the scenes, the overhaul is pretty significant. I've totally rebuilt the whole thing, it now uses Smarty, a long overdue change.

Anyway, as its so different in its layout to the old site I couldn't just update the old files with new files. I'm sure this is a common problem and others must scratch their heads at least a little bit when thinking about updating their sites. I found myself wondering, if Google started crawling my site and seeing an 'under construction' message, would it hurt my page rank? And of course there's the visitors to think about, its not exactly very user friendly is it, taking all your content offline for however long it takes to update the site (Quite a while considering I have to re-upload all the panoramas from the Dartmoor Panoramic Photography page).

I considered the possibility of using some sort of temporary redirect to point to my development server while I update the live server, but didn't really want the development server address getting around. Instead it occurred to me, after some time spent seeing if anyone else had this problem, to just move the old site into one folder on my server. Then I added an htaccess RewriteRule to send all links into that folder (without changing the address shown in the browser), effectively making that folder the new public root. The line to add in the .htaccess file is this:

RewriteRule ^(.*)$ /TEMPOLD/$1

That takes whatever comes after the domain section and adds /TEMPOLD/ (my new temporary folder) before it.

This change can be done seamlessly without any interruption just by overwriting the root .htaccess file once all your files are in the temporary folder. Once that is working you can then delete all files (apart from the .htaccess file and your temporary folder) from the server. Now you have an almost empty server to upload your new files to, and all the while your site is carrying on as normal. Once you've uploaded your new files just delete the .htaccess file (or replace it with one for your new site) and in an instant your new site will be live and complete. To complete the transition just remove your temporary folder, you might want to back it up though.

15 Oct 07

Comments RSS

  1. What program do you use to do this with? We use MS Visual Studio 2005 to build/publish our site.

    17 Dec 08 22:46 Matt

  2. What program do you use to do this with? We use MS Visual Studio 2005 to build/publish our site.

    17 Dec 08 22:49 Matt