0

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>
2
  • have you 503.htm this page? Commented Feb 27, 2014 at 8:01
  • s i have that file in my project Commented Feb 27, 2014 at 8:05

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Although that's cool too it's no use for those cases where the apppool is merely overloaded or temporarily unavailable due to a recycling. I wonder if there's a way to customize the message in those cases.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.