404 handling in Azure website

后端 未结 1 1713
一整个雨季
一整个雨季 2021-02-07 20:04

I have got an MVC website on Azure. I have written a controller action to stand in for a resource, that should return HTTP 404, but the body content should be some HTML where I

相关标签:
1条回答
  • 2021-02-07 20:29

    I was able to fix this by adding this httpErrors entry to the web.config:

    <configuration>  
      <system.webServer>  
        <httpErrors existingResponse="PassThrough"/>  
      </system.webServer>  
    <configuration>
    

    I found this answer here:

    http://blog.dezfowler.com/2010/09/aspnet-custom-error-not-shown-in-azure.html

    0 讨论(0)
提交回复
热议问题