Search code examples
asp.net.htaccessazureiis-7.5webmatrix

Redirect all pages to holding page - Azure Website


I've built a custom holding page for my site when I take it down for maintenance.

I know how to change the default page to use the new page, but how do I redirect ALL pages to it temporarily? (ie, www.mysite.com/page1).

My site is hosted in Azure as a Basic website. My site is written in ASP.NET Web Pages.


Solution

  • You should use an App_Offline.htm file when you take your site offline for maintenance. If you add a file with that name to the root of your Web Pages site, the site will be unloaded by IIS and the content of the page displayed instead. As soon as you remove the file (or change its name), the site will be restarted.

    http://weblogs.asp.net/scottgu/426755