Take a site offline with app_offline.htm

Stop the application gracefully during a deployment so files are not locked.

app_offline.htm is a special file understood by ASP.NET. While it exists in the root of your website, the application is stopped and visitors see the content of the file instead. Use it to release locked files during a manual deployment, or to show a maintenance message while you change the configuration or fix a problem.

The web server checks for the file on every request. When it finds it, it stops the application, including its running worker processes, and returns the content of the file as the response to all requests. Once the file is removed, the application is started again and requests are processed as usual.

How to use it

  1. Create app_offline.htm

    Any HTML content works, for example:

    <!DOCTYPE html>
    <html>
    <body>
      <h1>We are updating the website</h1>
      <p>Please come back in a minute.</p>
    </body>
    </html>
    
  2. Upload it into wwwroot

    Place the file directly in the wwwroot folder of your website.

  3. Deploy

    Wait a few seconds for the application to stop, then upload the new version of your files.

  4. Remove the file

    Delete app_offline.htm. The application starts again with the next request.

Important

Keep app_offline.htm smaller than 512 KB. A larger file is ignored by the web server.

Tip

The Stop button on the Overview page of a website in the Control Panel does the same thing — it creates the app_offline.htm file for you.

When you do not need it

Web Deploy from Visual Studio stops and starts the application automatically, so with Web Deploy you do not need this file at all. Tools such as Visual Studio and MSDeploy may create and delete app_offline.htm themselves during a deployment.

Still stuck? Our support team is happy to help.
Ask the community Open a support ticket