perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eli Shemer <ap...@netvision.net.il>
Subject RE: redirect
Date Sat, 06 Oct 2007 18:03:36 GMT
$r->headers_out->set("Refresh"=>"0;url=index.pl");

$r->headers_out;
return Apache2::Const::OK;                     

this method seems to be the best solution for me since
1. it works
2. I rather send an OK signal since it's not an actual warning/error but a
valid redirect as part of the system.

Thanks a lot. 

-----Original Message-----
From: Issac Goldstand [mailto:margol@beamartyr.net] 
Sent: Saturday, October 06, 2007 7:02 PM
To: Eli Shemer
Cc: modperl@perl.apache.org
Subject: Re: redirect

Sounds like you're doing something not-quite-right...  A 302 status code
in conjunction with a Location header should immediately redirect to the
URL in the Location header.

If you'd rather, you can try sending a normal 200 (OK) response with an
empty HTML page, and a Refresh header (something like [mp1 code, but you
should get the idea]):
    $r->header_out("Refresh"=>"0;url=http://www.mydomain.com/");
    $r->send_http_header("text/html");
    $r->print("<HTML></HTML>");
)

  Issac

Eli Shemer wrote:
> I have previously have done this but instead of actually automatically
> referring me, it displayed an error with a link that "the paged has moved"
> or something of that sort.
> 
> 
> -----Original Message-----
> From: Issac Goldstand [mailto:margol@beamartyr.net] 
> Sent: Saturday, October 06, 2007 6:15 PM
> To: Eli Shemer
> Cc: modperl@perl.apache.org
> Subject: Re: redirect
> 
> Send a Location: header back instead of a full response and return
> HTTP_MOVED_TEMPORARILY from your handler.
> 
> If you want/need to return a response from the page, you can
> alternatively use an HTML META tag in the header to accomplish the same
> effect.
> 
>   Issac
> 
> Eli Shemer wrote:
>> Hey there,
>>
>> I constructed a logout button which simply refers you to a page that
>> takes away your cookie and then redirects you the main page.
>>
>> Internal_redirect however does not seem to be the best use in this case
>> since, apparently, the address bar is not updated accordingly and even
>> the cookie is not taken into account yet(I have to refresh the main page
>> "again")
>>
>>  
>>
>> One possible option might be porting Apache::Request::Redirect to
>> mod_perl2 but I wanted to hear more suggestions if possible.
>>
>> Preferrebly not using mod_rewrite or modifying any other apache
>> configuration.
>>
>>  
>>
>> Thanks all.
>>
> 



Mime
View raw message