Posts
27
Comments
57
Trackbacks
0
App_Offline.htm, taking site down for maintenance

There is much simpler and graceful way to shut down a site while doing upgrade to avoid the problem of people accessing site in the middle of a content update.

 

Basically, if you place file with name 'app_offline.htm' with below contents in the root of a web application directory, ASP.NET will shut-down the application,  and stop processing any new incoming requests for that application. 

ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).

 

Then after upgrade, just rename/delete app_offline.htm file…and the site would be back to normal.

Just remember that the size of the file should be greater than 512 bytes, doesn't matter even if you add some comments to it to push the byte size as long as it's of the size greater than 512 - it'll work fine.

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Maintenance Mode - Outage Message</title>
</head>
<body>
    <h1>Maintenance Mode</h1>

    <p>We're currently undergoing scheduled maintenance. We will come back very shortly.</p>
 
    <p>Sorry for the inconvenience!</p>

   
<!--       
    Adding additional hidden content so that IE Friendly Errors don't prevent
    this message from displaying (note: it will show a "friendly" 404
    error if the content isn't of a certain size).
   
    <h2>Site under maintenance...</h2> 
    <h2>Site under maintenance...</h2> 
    <h2>Site under maintenance...</h2> 
    <h2>Site under maintenance...</h2> 
    <h2>Site under maintenance...</h2> 
    <h2>Site under maintenance...</h2> 
    <h2>Site under maintenance...</h2> 
    <h2>Site under maintenance...</h2> 
      
-->
</body>
</html>

 

 

 

posted on Wednesday, March 28, 2012 4:25 PM Print
Comments
Gravatar
# re: App_Offline.htm, taking site down for maintenance
taylormccuteon
5/29/2013 11:25 AM
.I have explain so many article of this site in which some of them were very intresting and inspiring.This article has good title with good description. manualarticlesubmission.biz/
Gravatar
# re: App_Offline.htm, taking site down for maintenance
Bob Harford
6/6/2014 7:03 PM
First thanks for the post. It would be handy though if somebody gave an actual example of "root of a web application directory"

Post Comment

Title *
Name *
Email
Comment *