Re: CGI.pm and ModPerl::Registry



On Dec 22, 2:06 am, Claudio Calvelli
<qwertyu...@xxxxxxxxxxxxxxxxxxxxx> wrote:
On 2007-12-22, steve.y...@xxxxxxxxx <steve.y...@xxxxxxxxx> wrote:

I'm in the process of upgrading to Perl 5.8.8, Apache 2.0, and
ModPerl::Registry, and CGI.pm v3.29.
Right now, all the redirects I do that follow POSTs are broken. They
produce status 200 instead of status 303 that I coded for. Any ideas
why or other advice?
Thanks very much.

The CGI.pm documentation suggests to use redirect rather than header
to creating redirections, so something along the lines of:

print $cgi->redirect(-uri=>$otherurl, -status=>303)

should work.

C


Thanks for the reply, Claudio. That didn't help, but I did find that
the problem was resolved by not printing any text after the header.
Apparently with text printed, CGI.pm reverts that status back to 200,
which seems reasonable. If you're redirecting, you shouldn't need any
text, and if you succesfully produce a web page, it's reasonable that
the status be 200.
So the status was coming through as 200 but there was a location in
the http header, which let to the result being a page that said:

OK
The answer to your request is located here

with *here* being a link to the url I was forwarding to.

The text was legacy support for browsers that might not support
forwarding (my service has been around since 1999!).

Hope all this helps anyone else that runs into this problem.

Steve
.



Relevant Pages

  • Re: can you "comment out" in an .htaccess file?
    ... I get refused on the basis of too many redirects, ... Is your custom 404 page sending a "404 Not Found" header? ... the url removal tool in a couple hours. ...
    (alt.internet.search-engines)
  • Re: [PHP] redirect with header still not working
    ... Ross wrote: ... Have tried the full url for the header and it still doesn't work. ... I may have to resort to...javacript redirects unless someone can suggest a way around it. ...
    (php.general)
  • Re: [PHP] redirect with header still not working
    ... Ross wrote: ... Have tried the full url for the header and it still doesn't work. ... I may have to resort to...javacript redirects unless someone can suggest a way around it. ...
    (php.general)
  • Re: can you "comment out" in an .htaccess file?
    ... I get refused on the basis of too many redirects, ... Is your custom 404 page sending a "404 Not Found" header? ... the url removal tool in a couple hours. ...
    (alt.internet.search-engines)
  • Re: can you "comment out" in an .htaccess file?
    ... I get refused on the basis of too many redirects, ... Is your custom 404 page sending a "404 Not Found" header? ... You can send the 404 header with some PHP. ...
    (alt.internet.search-engines)