views:

2105

answers:

2

I've read about the app_offline.htm file which can be placed within the root of a .NET 2.0 application which will in essence shut down the application and disable any other pages from being requested.

I've placed the file in the root, and my site still loads. I went into default documents in IIS and set it to app_offline.htm and the site still loads (this might have been a caching issue though)

Anyway, has anyone run into issues using this? Am I doing something wrong?

Thanks!

+1  A: 

Make sure that app_offline.htm is in the root of the virtual directory or website in IIS. Can you post a small example of the directory structure of your website and where in that structure you are putting the file?

Andrew Hare
It's definitely in the root.i have my inetput\wwwroot\[WebsiteDirectory]\app_offline.htm
Jack Marchetti
But is "WebsiteDirectory" configured as a virtual directory or is it simply a folder under the main website?
Andrew Hare
It's configured as a Website
Jack Marchetti
+13  A: 

I have used the extremely handy app_offline.htm trick to shut down/update sites in the past without any issues.

Be sure that you are actually placing the "app_offline.htm" file in the "root" of the website that you have configured within IIS.

Also ensure that the file is named exactly as it should be. "app_offline.htm" (but without the quotes, obviously!).

Other than that, there should be no other changes to IIS that you should need to make since the processing of this file (with this specific name) is handled by the ASP.NET runtime rather than IIS itself (for IIS v6).

Be aware, however, that although placing this file in the root of your site will force the application to "shut down" and display the content of the "app_offline.htm" file itself, any existing requests will still get the real website served up to them. Only new requests will get the app_offline.htm content.

If you're still having issues, try the following links for further info:

Scott Gu's App_Offline.htm

App_Offline.htm and working around the "IE Friendly Errors" feature

Will app_offline.htm stop current requests or just new requests?

CraigTP
The file I was pushing was named app_offline_.htm Damn retinal disease lol thanks tho! :)
Jack Marchetti
@JackM - No problem! In fact, I often leave the file on my website and call it something like "xapp_offline.htm". It therefore just sits there doing nothing. When I want to upgrade some or all of the site, I simply rename the file and remove the "x" prefix (this is usually done over FTP). This shuts down the site for me, I do the upgrade, then rename the file back with the "x" prefix!
CraigTP