When you’re making big changes or performing maintenance on a site that requires hours or days to finish, you should bring down your ASP.NET web application in a convenience way and display Site Down or Maintenance message to your visitors.
ASP.NET provides a simple way to implement this functionality is by using an app_offline.htm file that is placed in the root of the asp.net web application.
When ASP.NET sees the app_offline.htm file, it will display content of the file instead request your application. And we definitely don’t want this occur as the site will not function properly and annoy visitors.
Implement app_offline.htm to display the site down/maintenance message
- 1. Place the app_offline.htm file in the root of your ASP.NET web application.
- 2. When you’re done, simply delete or rename the file.
- 3. Your site will come back as normal.
Note: the app_offline.htm file must be greater than 512 bytes of content.
An example of app_offline.htm
This HTML content below will display the outage message:
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <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> </body> </html>