locked
customErrors impact in website RRS feed

  • Question

  • User206383436 posted

    I have an ASP.NET MVC website and added the following lines to <system.web> section:

    <customErrors mode="On" defaultRedirect="http://www.somesite.com">
      <error statusCode="302" redirect="http://www.somesite.com" />
      <error statusCode="404" redirect="http://www.somesite.com" />
      <error statusCode="500" redirect="http://www.somesite.com" />
    </customErrors>

    Is there any impact while loading the website?

    (Maybe the lines that contain "statusCode" are not needed because redirection is always the same URL)

    Best regards,

    Jorge Maldonado

    Monday, October 29, 2018 1:02 AM

Answers

  • User283571144 posted

    Hi JORGEMAL,

    As far as I know, the customerrors is used to provide information about custom error messages for an ASP.NET application.

    This is only fired when the error is thrown.

    Is there any impact while loading the website?

    (Maybe the lines that contain "statusCode" are not needed because redirection is always the same URL)

    The statuscode is used to set the redirect page according to differernt status code.

    If you want to redirect all the error to same page, you could directy set the defaultRedirect attribute in the customErrors tag.

    More details, you could refer to below article:

    https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-2.0/h0hfz6fc%28v%3dvs.80%29 

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 30, 2018 5:48 AM