Hi All,
I have created a HTTPModule for url rewrites. It checks the url for a .html extension (.html has been set in iis to be handled by aspnet_isapi.dll). It then checks a database for a match against the .html url, if found, it rewrites the corresponding aspx page. That works fine. My issue started when, I could not simply use CustomErrors or Response.Redirect for urls ending in .html but was not found in the DB (basically a bad URL) because CustomErrors or Response.Redirect throw 302, I need 404 (Search Engines). So, I let it pass so it will raise an Exception in the Error section of the HTTPModule. I check for a 404 status and if true, transfer to my page not found page. Works perfect, right, not on Windows 2003 (my dev server). It works fine on my local machine and bad aspx pages work on my dev server, but not the html pages. I get a HTTP 500 error. It is like after it leaves the begin_request in the HTTPModule it never gets to my error section in the HTTPModule. Sorry for the long post. Any help would be appreciated.
I have created a HTTPModule for url rewrites. It checks the url for a .html extension (.html has been set in iis to be handled by aspnet_isapi.dll). It then checks a database for a match against the .html url, if found, it rewrites the corresponding aspx page. That works fine. My issue started when, I could not simply use CustomErrors or Response.Redirect for urls ending in .html but was not found in the DB (basically a bad URL) because CustomErrors or Response.Redirect throw 302, I need 404 (Search Engines). So, I let it pass so it will raise an Exception in the Error section of the HTTPModule. I check for a 404 status and if true, transfer to my page not found page. Works perfect, right, not on Windows 2003 (my dev server). It works fine on my local machine and bad aspx pages work on my dev server, but not the html pages. I get a HTTP 500 error. It is like after it leaves the begin_request in the HTTPModule it never gets to my error section in the HTTPModule. Sorry for the long post. Any help would be appreciated.