If you're lucky enough to be performing a major site upgrade by switching to a new server, then your migration path is pretty simple: develop on the new server, test until the new application is stable, and then switch over to the new IP address. But if you don't have the luxury of a new server, you're probably going to have some downtime on the site while you upgrade to new code. So what code do you show your users in the meantime?
Since there could always be application-level problems during an upgrade (perhaps you're altering database tables, changing session defaults, or site-wide layouts), you probably want to stick with a static HTML page to show your message. So what I do is create a redirect in the application code, practically in the first few lines, which sends all users to a static HTML page. That page tells the user that the site us undergoing planned maintenance and will be back up shortly. The page also contains a 10-minute refresh back to the application. If you are still upgrading or testing and have the application redirect in place, users will be returned to the static page for another 10 minutes; if you're done upgrading and testing and have removed the application redirect, users will see your new, upgraded application.