Phoenix.pm: CGI redirect question

Douglas E. Miles doug.miles at ns2.phoenix.bowne.com
Tue Dec 7 14:06:23 CST 1999


Phaedrus wrote:
> I'm hoping on this one late in the game... just making sure I understand
> the question right now, then I may or may not have anything useful to
> say..
> 
> >
> > I have something weird going on here...
> >
> > I have a cgi script that generates a couple of HTML pages from
> > templates, and then does a redirect to one of the generated pages.  The
> > problem is that the page is only about half there.  The weird part is
> 
> You generate a page, then do a Location: redirect? Are you buffering the
> output then disposing of it so that the Location: works, or do you not
> want the Location: to work if you have generated output? Which page is
> half there, the one redirected too?

No output is generated to STDOUT, except for the Location header, which
isn't generated until AFTER the page is generated.  The redirect points
to the page that was generated.
 
> > that this has been working fine for a couple of months.  I'm wondering
> > if somehow the redirect is reaching the browser before the page is
> > finished generating, thus killing the CGI before it completes.  The only
> 
> That would explain it, but an out of context Location: header is
> meaningless... Hmm...

I'm not sure what you mean here.  Can you expound?

> > way that I can think of this happening is if the web server (apache on
> > RH Linux) is somehow caching the redirect response.  Any thoughts?
> > Also, it works fine from the command line.  Thanks!
> 
> Tell me how this is supposed to work, and if you are using buffering on
> the output, and what kind... and I'll take a shot at it..

There shouldn't be any buffering going on.  I'm still betting that its
apache that is screwing me up.

-- 
For a list of the ways which technology has failed
to improve our quality of life, press 3.



More information about the Phoenix-pm mailing list