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开发者_JAVA技巧 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?
Use App_Offline.htm
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.
Use a rewriting filter, like IIRF. Configure it to rewrite ALL pages to your maintenance page.
problem solved.
app_offline.htm is the way to go indeed. To automatically restore your site, you can simply use a scheduled task.
精彩评论