IIS - How to take your website offline for update or maintenance

Place a file called app_offline.htm in the root directory of your website.
IIS will return the contents of this file, along with a HTTP 503 status code for every single request.
This means you can't reference any external resources. Everything you need has to be inline in the page (or on a different server).
< HTTP/1.1 503 Service Unavailable
< Content-Type: text/html
< Retry-After: 3600
< Server: Microsoft-IIS/10.0
< Date: Sun, 04 Feb 2018 02:04:19 GMT
< Content-Length: 108
We are currently offline for maintenance.
Please check back later.

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath