![]() ![]() Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)ĭim lastError As Exception = Server.GetLastError() Here is my complete code still it's not working To do this, I don't know if this suggestion might be a rabbit hole. You might be able to write a custom IHttpHandler that is tripped by "*.htm*" files and register it in your web.config and test file existance (File.Exists()) and upon failure, perform a manual redirect to your 404.htm file, but as I have not had occasion Your hosting provider to customize what IIS provides as a 404 page. htm for the error redirect pages, which can often be advisable, especially if there is a serious issue on the server that is impeeding the serving of dot net content.Īs web.config configured 404/500 and other errors are not processed except when the requested file is a dot net file extension (meaning handled by the dot net hanlders for serving out of IIS), thus a custom 404 page for an HTM file will have to go through If you were to try to pull up Īnd this file did not exist, it would trigger your web.config 404 page because the file is a dot net handled file extension. There are tweaky things your hosting provider MIGHT be able to do, but from an ongoing support standpoint, unlikely to do, that get around this within IIS error page configuration. ![]() If you try to go to and this page does not exist, it does not matter what your web.confg says is the 404 page, the ASP.Net handlers do not BY DEFAULT parse/handle No, I am refering to the file extension of the file REQUESTED. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |