How do I add a custom error page for HTTP 404 errors using Web.config?

Question

Grade: Education Subject: Support
How do I add a custom error page for HTTP 404 errors using Web.config?
Asked by:
70 Viewed 70 Answers

Answer (70)

Best Answer
(383)
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: ``.