Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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: 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:
  • 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?

In reply to Re^2: Changing http headers in cgi response by twotone
in thread Changing http headers in cgi response by twotone

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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:
    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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (7)
    As of 2020-01-17 18:17 GMT
    Find Nodes?
      Voting Booth?