I needed to extend it in order to support extension less url or other url that are not handled by asp.net.
By default BlogEngine provides me with the following custom error which only works for asp.net files.
<customErrors mode="RemoteOnly" defaultRedirect="~/error404.aspx"> <error statusCode="404" redirect="~/error404.aspx"/> </customErrors>
The solution was to modify the web.config, rather add the following piece of code to my <system.webServer> so that it gets handled by IIS (This requires IIS7).
<httpErrors errorMode="Custom" existingResponse="Replace" > <remove statusCode="404"/> <error statusCode="404" path="/error404.aspx" responseMode="ExecuteURL"/> </httpErrors>
Now even non asp.net files are handled like shown below.
Note: In path=”/error404.aspx”, it start with / not ~/. ASP.NET users should be careful with this otherwise it will not work.
For more information on <httpErrors> refer to the MSDN Library.