in reply to
Re: Changing http headers in cgi response
in thread Changing http headers in cgi response
Hmmm... It seems I wasn't clear enough in my question. I'm not trying to return Status 202 OK when the content isn't found. I'm just not wanting to create (let's say 50) identical cgi scripts for the 50 "virtual" pages I have in my database. I want to display any of those 50 pages by using only 1 script. The page would be chosen based on the URL content after the domain like this: domain.com/page/to/look/up/in/database/. So that when that page content is FOUND in the database, the content is returned with status 202.
This would be a the process step by step:
- Page is requested: doman.com/requested/page/
- My script is registered as custom 404 handler
- script does database query for requested/page/
- if found, requested/page/ is returned with 202 OK
- if not, 404 not found is returned
I set up a drupal site once on a server that didn't do url rewriting and this was exactly the way drupal did it. I just don't remember if it modified the 404 status to 202.
SO, can any one tell me how to change the 404 status header to 202 when I send back the found page?