in reply to Re: Apache::Registry and redirection
in thread Apache::Registry and redirection

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.

Replies are listed 'Best First'.
Re^3: Apache::Registry and redirection
by perrin (Chancellor) on Sep 29, 2006 at 23:50 UTC
    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 :-)