Why does the ASP.NET error page return 404 as soon as the request appears using aspxerrorpath?

I configured the ASP.NET application as follows:

<customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx"/>

When I look at the ~ / Error.aspx file, the server returns 200 and the page is displayed. But if the user is redirected to the page with an error, a request is added to the path:

/Error.aspx?aspxerrorpath=/Test.aspx

But whenever this request is used, the server does not display the error page, instead, it returns 404 using the server’s user error page, not Error.aspx

Why is the web.config setting not showing up in ~ / Error.aspx?

+3
source share
1 answer

, . - ASP.NET(. ), URLScan, urls querystring "aspxerrorpath =" . , URL- , ASP.NET, 404.

, , "aspxerrorpath = xx" URL- , 404.

, asp.net, , .

+2

Source: https://habr.com/ru/post/1773035/


All Articles