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

iisiis-6windowswindows-server-2003

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?

Best Answer

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).