Question
How do I add a custom error page for HTTP 404 errors using Web.config?
Asked by: USER9335
70 Viewed
70 Answers
Answer (70)
To add a custom error page for 404 errors, use the `` section within your `Web.config` file. Set `mode="On"` to enable custom errors and then add an `` element with `statusCode="404"` and `redirect="/Custom404.aspx"` (or your desired error page path). For example: ` `.