2

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?

p.campbell
  • 4,407
  • 6
  • 41
  • 51

1 Answers1

9

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

splattne
  • 28,508
  • 20
  • 98
  • 148
  • Note: I wrote the answer before the question was edited adding the "app_offline.htm" part. :-) – splattne Jul 27 '09 at 13:19
  • Brilliant! I wasn't aware of app_offline.htm -- you just solved a very similar problem for me :-) – Chris_K Jul 27 '09 at 13:20
  • 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! – p.campbell Jul 27 '09 at 13:35