How to configure Downtime message on Windows server IIS. SEO friendly

This article will let you know the best way to configure downtime message on your Window Server.

Requirement

  • IIS 7
  • URL Rewrite
  • Knowledge of IIS and web.config

Watch video –> How to configure SEO friendly downtime on IIS

Append the following code in you existing web.config. This will show the message as display in statusReason name’s value.

<system.webServer>
    ...
    <rewrite>
        <rules>
            <rule name="DownTime" stopProcessing="true">
                <match url=".*" />
                <action type="CustomResponse" statusCode="503" statusReason="Website is down for maintenance" statusDescription="We will be back up soon" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

If you want to have show a custom page include the following web.config tag along with above.

<system.webServer>
      ...
     <httpErrors existingResponse="Auto" errorMode="Custom" defaultResponseMode="File">
        <remove statusCode="503" subStatusCode="-1" />
        <error statusCode="503" path="my503.html" />
     </httpErrors>
</system.webServer>

my503.html – Design this page as per your requirement. CSS/Images require to be hosted on another website as current website is down and all request will come to my503.html.

How to TEST?

example.com – Should shown downtime message

example.com/working-page.aspx/php/asp – Should shown downtime message

Suggestion

As IIS is ON so technically the website is up and running. During downtime if something goes wrong and the web.config with 503 error code is removed. Your website will come online. To Avoid this situation you should change the physical path of your website to a new folder which only hosts a web.config and downtime HTML file.  

Why it is SEO friendly?

All site page will give 503 status code which will tell search bots that site is currently unavailable and will be up shortly.

503 Service Unavailable – The server is currently unavailable (this could be due to overload or maintenance). Search engines will know that this is a temporary state. This status code should be used when taking down a site for maintenance.

Leave a Reply

Your email address will not be published. Required fields are marked *