Home › Resources › Articles

How to Take an IIS Web Site Offline

(Microsoft .NET,Microsoft IIS,Microsoft ASP.NET) by Jason Skowronek on 10/27/2009

App_Offline.htm Static Override Page (prefered)

Adding a file in the application root named App_Offline.htm automatically causes the AppDomain to recycle and modifies its behavior such that any request for an ASP.NET resource returns the contents of the App_Offline.htm file instead (along with an HTTP 404 status). Deleting App_Offline.htm automatically recycles the AppDomain again and the web application is back to serving its usual content.*

  1. Create a static HTML page called App_Offline.htm
  2. Filesize must be at LEAST 512MB and cannot exceed 1MB in order to work properly as an offline mode trigger

Redirect the entire IIS Application (alternative)

  1. Create an offline or maintenance mode web page (per design specifications or use default version) and save the page to the application root directory
  2. Open IIS manager on the web server that is hosting the site/application
  3. Right-click the site/application name | Properties
  4. Click the "Home Directory" tab (or "Virtual Directory" tab if an application)
  5. Select "A redirect to a URL"
  6. Enter the fully qualified URL to the offline page
  7. Check "The exact URL entered above" checkbox
  8. Click Apply | OK

Leave a comment
Name *
Email *
Homepage
Comment

Online Backup, Ektron Consulting, Ektron Hosting