Wednesday, August 18, 2010

Take your web application offline without any change in web server or application

This might come handy when you are in maintenance mode of your application and you want to let your user know it. How would you do it without shutting down your application or without writing additional code to redirect all requests?
The only thing you have to do is to create a file with name app_offline.htm, decorate it however you want and just put it inside the root directory of your application. Rest everything will be taken care of .NET handlers. All users visiting to your site will automatically see your offline page.
Whenever you want your application to be up, just remove that file and that's it.

No comments:

Post a Comment