Friendly Error Page App_Offline.htm

In ASP.NET 2.0, while you’re in the process of updating your site, you can expose a friendly error page by including a file called app_offline.htm in your site’s root. If this file exists, all requests to the site will be redirected to this page. The only way to get around this is to delete the file. The usage scenario for this is for site maintenance, and it can be easily included as part of a deployment script, where this is the first file added and the last file deleted during the deployment. You can read more about this feature here.

Excerpt:

To take a Web application offline before deployment

  1. Create a file called App_offline.htm and place it in the root of your target Web site.
  2. Put a friendly message in the App_offline.htm file to let clients know that you are updating the site.

While the App_offline.htm file exists, any request to the Web site will redirect to the file.

NoteImportant

Remember to remove the App_offline.htm file after you are finished copying files.

If you liked this post, consider subscribing to email updates about my new posts, or sharing it on Hacker News.

Keyboard shortcuts

?
Show this help
Esc
Close this help or an open menu
n
Next (newer) post: New Site: DotNetSlackers
p
Previous (older) post: Visual Studio 2005 Web Deployment Projects
Tab
Move between links and buttons (Shift+Tab to go back)