HTTPModule Error does not fire on HTML Extension

Joined
Oct 23, 2007
Messages
1
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top