techieman
06-07-2006, 09:04 AM
Hi,
In my application, I want to redirect user to a specific error page when a wrong page name is given in URL. What I have done is following in web.config of my website:
<customErrors mode="On" defaultRedirect="Errors/errorpage.aspx">
<error statusCode="404" redirect="Errors/HTTPErrors.aspx"/>
</customErrors>
It works fine for .aspx files. But what about files with other extensions e.g. .htm. So for this I have added following piece of code in web.config of my website:
<httpHandlers>
<add verb="*" path="*.htm" type="System.Web.StaticFileHandler" />
</httpHandlers>
But its not working... I guess I need to map extension to ASP.NET isapi in IIS. i.e. IIS->Website->Configuration->Mapping-> ADD
But in this dialog box for adding the details Ok button is shown disabled..
So what to do now?
If any one has any idea then please help me ASAP...
In my application, I want to redirect user to a specific error page when a wrong page name is given in URL. What I have done is following in web.config of my website:
<customErrors mode="On" defaultRedirect="Errors/errorpage.aspx">
<error statusCode="404" redirect="Errors/HTTPErrors.aspx"/>
</customErrors>
It works fine for .aspx files. But what about files with other extensions e.g. .htm. So for this I have added following piece of code in web.config of my website:
<httpHandlers>
<add verb="*" path="*.htm" type="System.Web.StaticFileHandler" />
</httpHandlers>
But its not working... I guess I need to map extension to ASP.NET isapi in IIS. i.e. IIS->Website->Configuration->Mapping-> ADD
But in this dialog box for adding the details Ok button is shown disabled..
So what to do now?
If any one has any idea then please help me ASAP...