views:

237

answers:

4

I have a site that will be "down" for a few hours while a third party (CC processor) performs maintenance (in other words, the machine will still be online/running). I have already created a maintenance.aspx page. At first, I was going to simply add the new page as the default document in IIS (Server 2003, IIS 6.0), but this still leaves the possibility of someone directly navigating to the real login page.

Is there someway to do a redirect of all pages in a given site to the new maintenance page. Also, the site will be down from 2am-4am, so for extra bonus points, is there a way to automatically do this using the system clock (and prevent me from having to be around for this)?

I am planning on giving an error during login to prevent any access, but I'd rather the users not even be able to make it that far.

Suggestions?

+1  A: 

Use a rewriting filter, like IIRF. Configure it to rewrite ALL pages to your maintenance page.

problem solved.

Cheeso
+11  A: 

Use App_Offline.htm

Zote
Very cool. I had never heard of this before, but that is a testament to my desire to stay away from all things IIS. Thanks!
IniTech
Amazing! I've been needing this for years but had never heard of it. Great stuff
Richard Bysouth
+4  A: 

Sounds like you want to use an App_Offline.htm file. Details over here:

http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx

To automate, you would just create a Windows Scheduled Task to move this file in and out of your application's root directory at the desired times.

Kyle Chafin
I'm an idiot, so +1 for reminding me about scheduled tasks
IniTech
A: 

app_offline.htm is the way to go indeed. To automatically restore your site, you can simply use a scheduled task.

jeroenh