Menu

Want to work with us? We're on the lookout for a UX/UI Designer and Digital Project Manager.

We're hiring

Custom 404 Errors Azure

Web Bureau


27 June 2013 by Web Bureau

I came across an issue tonight where first I didn't have a 404 error page setup and then secondly when the custom errors where setup I wasn't getting the 404 error message page for extensions and extensionless urls.
The first this is to setup custom error in the web.config add this in the system.web section.
<customErrors mode="On">
<error statusCode="404" redirect="/404-error.aspx"/>
</customErrors>
Secondly add this to the system.webserver section
<httpErrors errorMode="Custom">
<clear/>
<error statusCode="404" path="/404-error.aspx" responseMode="Redirect"/>
</httpErrors>
One other thing to note is the redirect in the customErrors section and the path in the error section must point back to the route "/".

 

Grow your businessStart a project with us today.