Hello,

A few months ago, I wrote to this group because
external redirects for requests from internal
redirects were not working while redirects from normal
requests worked fine.  I was running in registry mode
and was told that that was probably the source of the
problem.  However, I have changed my config so that
all scripts run as handlers but I am still having the
same problem:

1. redirect from normal request works fine
2. redirect from internal redirect results in a '302
result' although I am using the same code for each.

The concept is as follows:

http request w/ posted data --> 1st handler
-->internal redirect --> 2nd handler --> back to
client with redirect header 

The code is as follows:

use strict;
use Apache2::RequestRec();
use APR::Table();
use Apache2::Const  qw( OK FORBIDDEN REDIRECT :log );
use Apache2::Log;

sub handler {

    # Get request object
    my $r = shift;

    # Check if coming in from internal redirect
    if( defined $r->prev ) {
        $log->log( "entering from internal redirect"
);
        $r = $r->prev;
    }

    # do some stuff...

    # Redirect if required
    if( $redirectURL ne '' ) {
        $log->log( $user . " redirecting to " .
$redirectURL );
        $r->headers_out->set( Location => $redirectURL
);
        $r->status( REDIRECT );
        return REDIRECT;
    }

}

1;

Any one have any ideas why the redirects from internal
redirects don't work?  Why is this so hard?  Any help
appreciated.

Thanks in advance.

Michael

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to