in reply to Apache::Registry and redirection

You're using CGI.pm, right? It doesn't know about your internal redirect. You need to call CGI::initialize_globals() after the internal redirect.

Replies are listed 'Best First'.
Re^2: Apache::Registry and redirection
by BarMeister (Beadle) on Sep 29, 2006 at 22:13 UTC
    That doesn't seem to work...still get the exact same results. Here is my subroutine:

    sub redirect { my $new_url = shift; my $include_old_url = shift; my $redirect = q{http://} . const('host') . $new_url; $redirect .= q{?} if $redirect !~ /\?/; $redirect .= q{&redirect=} . escape(url()) if $include_old_url; my $request = Apache->request(); $request->internal_redirect($redirect); CGI::initialize_globals(); return; }

    I am basically trying to do an entirely new request to the apache server without alerting the client.

      It doesn't work because it doesn't come back here until your redirect is over, so it doesn't run that code. You have to run the initialize_globals call in your subrequest that you redirected to. You can try calling it just before the internal_redirect, but I'm not sure that will work.
        Ok I figured it out... the trick is to update $r->args before calling CGI::initialize_globals and then do the internal_redirect after all that is done.

        Thanks for the help :-)