Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Taking Down a Website for Maintenance - ASP.NET

RSS
Modified on Tue, Sep 10, 2019, 12:39 PM by Administrator Categorized as ASP·NET MVC, ASP·NET Web Forms, HTML and CSS, Windows (OS, IE, IIS, and MSMQ)
Two things are required to take down an ASP.NET website for maintenance.

  • A file named app_offline.htm must be in the root of the web application. Note that the file extension is .HTM — NOT .HTML!

  • The file must be at least 512 bytes long.

Whenever anyone tries to access any page on the site under the above conditions, they are presented with the contents of the app_offline.htm file and the HTTP status code 503 (Service Unavailable).

Sample APP_OFFLINE.HTM file
<html>
<head>
</head>
<body>
This website is temporarily offline for maintenance.  Check back soon.
<br/>
<br/>
<br/>
<span style='font-size:0.7em;color:blue'>The message appears because of the <kbd>app_offline.htm</kbd> file 
in the website's root folder. Remove or rename it when maintenance is completed.</span>
<!-–
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae velit ligula. Sed euismod nullam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae velit ligula. Sed euismod nullam.
–->
</body>
</html>

A less verbose sample APP_OFFLINE.HTM file
<html>
<head>
</head>
<body>
This website is temporarily offline for maintenance.  Check back soon.
<!-–
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae velit ligula. Sed euismod nullam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae velit ligula. Sed euismod nullam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae velit ligula. Sed euismod nullam.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae velit ligula. Sed euismod nullam.
–->
</body>
</html>

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.