Article:
  Build Your Own Apache Server with mod_perl
Subject:   302 Messages
Date:   2003-11-26 18:01:34
From:   cshannon
I have a mod_perl web app based on CGI::Application and CGI::Formbuilder. I developed the app on my Win2000 workstation at the office, and am in process of porting it to my OSX box. I've got perl 5.8.0 installed, and Apache 1.3.29, mod_perl/1.29. Most everything seems fine now, except one thing. Using CGI.pm (I know, I know - there's a better way, I'm just lazy and haven't looked into it) I use a redirect to another URL, but in the browser I get a 302 message (The document has moved here - with 'here' linked to the redirect url). My app doesn't do this on my Win box, which is running Apache2. I've used this same function before on a Sun box running Apache 1.3.26, and never got a 302 message.


I cannot figure how to skip this server message, and since I never get this screen from my other dev platforms, and I've tested to show it is not the browser, but the server, how can I make the browser redirect.


Just to add some detail, CGI::Application uses screen modes, so when a form is submitted, I input the form data into a database, then redirect the browser to a different screen mode, so that I don't have to redundantly construct the mode's HTML in my code.


The only way I got around it so far (and this is not a final solution, I hope) was to do an LWP get on the redirect url, then print the contents back to the browser. This seems ridiculous to me, but perhaps I am ridiculous for using CGI's apparently heavy redirect function.


Any ideas would be much obliged. Thanks for the great Apache/mod_perl info on the site!

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • David Wheeler photo 302 Messages
    2003-11-30 09:19:37  David Wheeler | O'Reilly Author [View]

    Google is your friend.

    HTH,

    David
    • 302 Messages
      2003-12-02 11:38:00  cshannon [View]

      Yeah, I saw that already. Believe me, I've been all over Google for days before posting here. My CGI.pm is up to date, according to CPAN. I'm not near my system, but will have to check version of CGI when I can. I'll take another look at that message to see if there's something I've missed, but so far, the only thing that worked was using LWP to get the page , then print its content back to the screen. I've tried printing headers, not printing, turning off PerlSendHeader, turning it on - nothing gives me the desired result. Thanks for the response.