Should you find yourself needing to perform maintenance on a website, rather than just alarming your end users would it not make much more sense to make them aware when maintenance is occurring. For that matter instead of going thru the time and effort to log into the server, fire up the IIS management console and stop the web server Microsoft provides an easy solution by employing what is known as an App_Offline.htm web page. If you upload this file into the root of your application, every request for a page on your server will automatically be routed to this page and therefore shown to the user.
Once you have completed you maintenance all that remains is to simply delete the App_Offline.htm web page and your application is up and running again. Note: The caveat is that the App_Offline.htm file must be longer that 512 bytes otherwise instead of its content you will get a HTTP 404 error.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"> <html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" > <head> <title>Maintenance Alert</title> </head> <body> <h1>Maintenance Alert</h1> <h2>This site is temporarily down for maintainence...please check back later.</h2> � <!-- � Adding additional hidden content so that IE Friendly Errors don't prevent this message from displaying Note: it will show a "friendly" 404 error if the content isn't greater than 512 bytes. � <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> <h2>This site is temporarily down for maintainence...please check back later.</h2> � --> </body> </html>
Related posts:





