How can I indicate to users that my IIS website is undergoing maintenance?

IisRedirect

Iis Problem Overview


For my IIS website, I'd like to redirect ALL requests to ONE page. The purpose of this is that I want to do some maintenance on the database (take it off-line) that all my web applications use. I have about 50 web apps running under this website, so I'd like to avoid visiting each of them to change something. I'm thinking I could make a single change in machine.config? Any hints would be appreciated.

Iis Solutions


Solution 1 - Iis

If you are using ASP.NET 2.0 (or higher), you can drop an app_offline.htm page on the root.

More info here.

Solution 2 - Iis

in webconfig

 <rewrite>
        <rules>
            <rule name="redirect all requests" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
                </conditions>
                <action type="Rewrite" url="index.php" appendQueryString="true" />
            </rule>
        </rules>
    </rewrite>

Solution 3 - Iis

Make all the pages un-available, probably stop the current web site and create an entire new completly blank site in its place. Then put up a custom error page for the 404 (file ot found) error. Custom Errors is a tab on the properties dialog of the web site in IIS. Just create the page you want to send, then change the entry for 404 on the custom errors tab to point to the new file you just created.

Solution 4 - Iis

In IIS 10 there is an optional component "HTTP Redirect" (it may be available in earlier IIS versions; I don't know). It allows you to set up very simple catch-all redirects, using any of the common HTTP redirect response codes. This can be installed via Server Manager, in Windows Server 2019.

Solution 5 - Iis

Could you create a new site in IIS with a binding to port 80 with a blank host-header (much like the Default site) and then stop the other site(s)? That way all requests would be handled by the new site, which could simply be a static HTML page notifying users that the site is down for maintenance.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionClift NorrisView Question on Stackoverflow
Solution 1 - IisLordHitsView Answer on Stackoverflow
Solution 2 - Iisse_pavelView Answer on Stackoverflow
Solution 3 - IispipTheGeekView Answer on Stackoverflow
Solution 4 - IisStuartNView Answer on Stackoverflow
Solution 5 - IisLazlowView Answer on Stackoverflow