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?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||