404 error produces 302 response
am 02.03.2007 17:21:56 von nutso fasstHello.
IIS 4 website with a custom 404 error page WAS working OK, but at some
point it wacked out. In the logs there were no 404 error responses. Instead,
what were recorded were 200(OK) responses with my custom 404 page.
Researching, I found that when a non-existent resource was requested,
instead of directly responding with the 404 error page, the server responded
with 302 (Found / Moved
Temporarily) and a redirection to my custom error page. The redirection URL
had a querystring added, e.g.:
http://mysite.com/my404.asp?404;http://mysite.com/nofile.htm
I added Response.Status = "404 Not Found" at the top of the error page to
ensure a 404 response, but the redirection and logging anomaly continued.
I went back to the default .htm error page and behavior returned to normal.
I noticed that my404.asp called a component and wondered if that could be
the problem. So I edited, then specified that page for 404 error. Strangely,
it seemed to work OK initially but quickly reverted to bad behavior. So I
switched back to an HTML error page.
This website is a physically-congruent subset of another website and shared
the asp error page so I though that might be the problem. But when I gave
the other site a different copy of the error page the problem not only
persisted, the second site began exhibiting the same behavior.
All's OK using HTML error files, but I'm curious if anyone has a clue as to
the cause/cure of the bad behavior with ASP.
thanks,
nf