Question is: Why is custom Error handling not working for non-existing paths/directories?
Updated with fixed code (thanks to everyone for you input):
You need to set up wildcard mapping so that all requests go through .Net
if your using IIS6 the following link should help you out:
http://professionalaspnet.com/archive/2007/07/27/Configure-IIS-for-Wildcard-Extensions-in-ASP.NET.aspx
Wildcard script mapping and IIS 7 integrated pipeline:
http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/