简体   繁体   中英

iis custom error page not working

I create a error page in iis for 503 error. Now i stop my website application pool. i got the other page service unavailable not my custom error page. I also try to config in web.config. It's not working please help me..

tried 1

<httpErrors errorMode="Custom">
      <remove statusCode="503" subStatusCode="-1" />
      <error statusCode="503" prefixLanguageFilePath="" path="/503.htm"
             responseMode="ExecuteURL" />
    </httpErrors>

tried 2

  <customErrors mode="On">
      <error statusCode="503" redirect="~/503.htm"/>
    </customErrors>

if the site is stopped this means no instance is listening to requests to this site. thus it is not possible to do so by web.config.

If what you mean is to use a custom page for site maintenance, you can take use of the app_offline.htm file:

Taking an ASP.NET Site Offline with a Message http://weblogs.asp.net/pleloup/archive/2008/09/22/taking-an-asp-net-site-offline-with-a-message.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM