IniTech
IniTech

Reputation: 781

Redirect site visitors during maintenance

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?

Upvotes: 3

Views: 2107

Answers (4)

Kyle Chafin
Kyle Chafin

Reputation: 607

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.

Upvotes: 7

jeroenh
jeroenh

Reputation: 26772

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

Upvotes: 0

Zote
Zote

Reputation: 5379

Use App_Offline.htm

Upvotes: 12

Cheeso
Cheeso

Reputation: 192417

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

problem solved.

Upvotes: 2

Related Questions