Failed to handle http error on azure

Solution to my problem: Added:

<httpErrors errorMode="Custom">
 <remove statusCode="403" subStatusCode="-1" />
  <remove statusCode="404" subStatusCode="-1" />
  <remove statusCode="500" subStatusCode="-1" />
  <error statusCode="404" path="/404.html" responseMode="Redirect"/>
  <error statusCode="403" path="/403.html" responseMode="Redirect"/>
  <error statusCode="500" path="/500.html" responseMode="Redirect"/>
</httpErrors>

      

Removed:

<customErrors mode="On">
      <error statusCode="403" redirect="~/403.html" />
      <error statusCode="404" redirect="~/404.html" />
      <error statusCode="500" redirect="~/500.html" />
    </customErrors>

      


I applied httpErrors in Web.config for my project, then when I test on localhost it is ok. However, when I post on azure image, it cannot handle http 500 and 403 errors. For example:

I tried url: www.mywebsite.com/content Localhost response: Ok, I get 500 pages or 403 Response to azure: "The page cannot be displayed because an internal server error has occurred."

My web.config:

<httpErrors  errorMode="Custom">
              <error statusCode="403" subStatusCode="14" path="403.html" responseMode="Redirect"/>
              <error statusCode="500" subStatusCode="19" path="500.html" responseMode="Redirect"/>
</httpErrors>

      

Why this is happening, I do not understand. Do you know anything about this problem?

+3
asp.net-mvc web-config azure http-error


source to share


No one has answered this question yet

Check out similar questions:

205
How to create custom error pages in ASP.NET MVC 4
29
Windows Azure websites are overriding my 404 and 500 error pages in my node.js app
26
Is it possible to use personalized error pages with an MVC site but not the Web API?
12
404 on Azure site
4
Skip CustomErrors and go to HttpErrors.
1
ASP.NET MVC custom error handling, blank page
0
Custom mode does not work as expected
0
How to properly handle HTTP errors in episerver?
0
Handle errors for Http and Ajax requests using the HandleError attribute class
0
Getting illegal 403 error when using httpErrors with replemode function as a redirect



All Articles
Loading...
X
Show
Funny
Dev
Pics