IIS6: Turn off or disable a virtual directory for downtime/upgrade

6,089

If your virtual directory is a separate ASP.NET application, you could put a HTML file with the name

 app_offline.htm 

in the folder the virtual directory is associated with. The file must have a minimum length of 512 bytes and should contain the HTML you want to show to your website's visitors.

This will cause every request to that application to show the app_offline.htm page. See this blog post (Scott Guthrie).

Share:
6,089

Related videos on Youtube

p.campbell
Author by

p.campbell

Developer in the Microsoft .NET & SQL Server stack. I am focused on delivering great applications in small iterations. I've developed solutions in the healthcare, manufacturing, and transportation verticals. My open source projects on GitHub. Continuously learning.

Updated on September 17, 2022

Comments

  • p.campbell
    p.campbell over 1 year

    Consider you have a website with many virtual directories. Each VD is configured as an application.

    How would you, in effect, turn off just ONE of those VD, or have it redirect to another page? You want to be sure that you don't turn off the entire site and all the other VD.

    The scenario here is that there is a downtime or deployment happening, and you would like to redirect to an app_offline.htm page.

    Question: How would you go about temporarily disabling just one virtual directory?

  • splattne
    splattne almost 15 years
    Note: I wrote the answer before the question was edited adding the "app_offline.htm" part. :-)
  • Chris_K
    Chris_K almost 15 years
    Brilliant! I wasn't aware of app_offline.htm -- you just solved a very similar problem for me :-)
  • p.campbell
    p.campbell almost 15 years
    Thanks splatt. I think the app_offline bit in there on rev.1. You did help with the important configuration of the VD being an application. Thank you very much!