3

I searched and didn't find a suitable answer.

I have a custom 404 page that, when triggered:

  1. parses the requested URL for a specific string
  2. checks a database for this value
  3. inserts specific HTTP header(s) based on results returned from db

Depending on the condition, I will send this to the browser:

Response.AddHeader "Location", a_dynamic_url
Response.Status = "301 Moved"

When the specific string is found in my database, the client browser behaves as desired by loading the dynamic URL I've set in the location header.

Here's my issue...

When the specific string is NOT FOUND in my database, I'm unable to set status to "404 Not Found" and display custom HTML in the browser.

I can do one or the other, but not both at the same time. It's either the 404 status, or custom HTML (with status of 200).

In contrast, if you use HTTP Fox in Firefox to see the request/response headers, then navigate to an unknown bit.ly URL (like: "bit.ly/asdfasdf") the status returned is 404 and the HTML is custom.

Any ideas on how I can rig IIS 6 to do the same thing with Classic ASP?

1 Answer 1

2

Are you aware of the "IE Friendly Errors" and the 512 bytes of content that your HTML needs to have to make sure that your HTML (instead of IE's friendly status message) shows up to your users?

http://weblogs.asp.net/scottgu/archive/2006/04/09/442332.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

First thing I found was that I misrepresented one facet of my issue. I was getting the Google Toolbar "Ooops, this link appears to be broken" response. I did actually try to put some miscellaneous content on the page to make sure the size was large enough, but apparently I didn't put enough in there. I added about 1000 lines of commented garbage and the response worked as I needed to. Thank you for pointing me in the right direction. (previous comment deleted.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.