Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net not displaying a custom 404 page as configured

in my web config I have:

<customErrors mode="On">
  <error statusCode="404" redirect="~/error/404.aspx" />
</customErrors>

http://localhost/meh <-- standard 404 is shown

http://localhost/meh.aspx <-- custom 404 is shown

http://localhost/error/404.aspx <-- the custom error page I want shown for all 404 errors

How do I have to setup my web.config to send all 404 to my custom error?

Thanks

like image 911
Justin808 Avatar asked Mar 03 '11 19:03

Justin808


People also ask

Where is my custom 404 error page?

Find and click on the icon for Custom Error Pages. Select 404 Wrong Page from the list. You'll see a page with a text box.


1 Answers

You have to configure this in IIS. By default, only specific files will get routed through the ASP.NET framework... otherwise IIS will handle it. enter image description here

like image 154
Mike Cole Avatar answered Oct 02 '22 08:10

Mike Cole