maricusa:
Thank you, but I did that and still I'm not getting my 404 custom page for any extension different from .aspx I dont know what else to do.
Hi maricusa,
The resouces with .html, .ccc, and .whatever extension by default not handled by ASP.NET, because the requests for these resources will not be routed to ASP.NET ISAPI. However, the “customErrors” feature is provided by ASP.NET runtime. Since ASP.NET don’t handle these requests, the customErrors feature doesn’t work is the expected behavior.
As docluv said, you should add IIS mapping for these file extensions to ASP.NET ISAPI. I know you did that from your post but I would like to know how you did that exactly. For your reference, I provide the following steps below. Hope they are helpful to you.
1. Open IIS manager.
2. Right click the virtual directory of your web application, and then select “Properties”.
3. In the “Directory” tab, click the “Configuration…” button.
4. Click the “Add…” buttion to add mapping. For example, Exectable: C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll Extension: .ccc
However, this method only works for the mapped resources. If you want to provide the 404 error custom page for all the resouces with whatever extension, you should define “Custom Errors” in IIS. For example, please refer to the following steps:
1. Open IIS manager.
2. Right click the virtual direcory of your web application, and then select “Properties”.
3. Click the “Custom Errors” tab.
4. Double click the “404” item, which default content is “C:\WINDOWS\help\iisHelp\common\404b.htm”.
5. Change the “Message type” to “URL”.
6. Set the url of your custom page. For example: /VirtualDirectoryName/PageName.html