Saturday 15 December 2012

Shutting down an entire Website for Maintenance

Shutting down an entire Website for Maintenance

The best way to implement this is using the app_offline.htm file. ASP.NET 2.0 has provided a fantastic functionality using which the users will automatically be redirected to the “Down for Maintenance” page. Just add an HTML file named “app_offline.htm” to the root directory of your website. Adding this file will clear the server cache. When ASP.NET sees the app_offline.htm file, it will shut-down the app-domain for the application (and not restart it for requests), and instead send back the contents of the app_offline.htm file in response to all new dynamic requests for the application.

Please take a note that the size of the file should be more that 512 bytes to be displayed. If the size of the file is less that 512 bytes, then IE browser settings need to be changed manually. The "Show Friendly HTTP Errors" check box from the Tools->Internet Options->Advanced tab within IE settings need to be unchecked. If this check-box is not unchecked and the app_offline.htm file size is less that 512 bytes, then the standard IE “Page cannot be displayed” message will be shown.

To start the website again, just remove this file from the root folder of your website. This will trigger the ASP.NET engine to cache all the page contents and display the pages.

Hope It Helps..


No comments:

Post a Comment

Thank You for Your Comments. We will get back to you soon.

back to top