Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Forwarding manipulated URI

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


nitin.chawke at ge

Jul 9, 2005, 5:41 PM

Post #1 of 4 (343 views)
Permalink
Forwarding manipulated URI

Hi All,
I am using mod_perl's PerlTransHandler for manipulating the request URI.
And forwarding the manipulated URI. I am getting the desired result page in the response, but the browser url does not change to the redirected page. But if I do a request redirect after manipulating the URI, the chagned uri does show up in the browser. Is there any way I would manipulate the URI, get the response with the manipulated URI, change the browser URL without actually redirecting the request.

This is the code that I am using:
$r->uri($new_uri);
$r->headers_out->add('Location' => ($new_uri));

return Apache2::Const::REDIRECT;

This solves the purpose.

But I want to use something similar to below (this shows the page but the browser URL shows the old uri and not the manipulated):
$r->uri($new_uri);
$r->headers_out->add('Location' => ($new_uri));

return Apache2::Const::REDIRECT;


Any inputs are appreciated.

Thanks,
Nitin


jonas.alves at co

Jul 9, 2005, 7:00 PM

Post #2 of 4 (333 views)
Permalink
Re: Forwarding manipulated URI [In reply to]

I don't see any diferences in the tow ways you are showing. :)
But no, there is no way to change the browser url without redirecting
the request.

--Jonas

On 10 de jul de 2005, at 01:41, Chawke, Nitin (Corporate, consultant)
wrote:

> Hi All,
> I am using mod_perl's PerlTransHandler for manipulating the request
> URI.
> And forwarding the manipulated URI. I am getting the desired result
> page in the response, but the browser url does not change to the
> redirected page. But if I do a request redirect after manipulating the
> URI, the chagned uri does show up in the browser. Is there any way I
> would manipulate the URI, get the response with the manipulated URI,
> change the browser URL without actually redirecting the request.
>
> This is the code that I am using:
> $r->uri($new_uri);
> $r->headers_out->add('Location' => ($new_uri));
>
> return Apache2::Const::REDIRECT;
>
> This solves the purpose.
>
> But I want to use something similar to below (this shows the page but
> the browser URL shows the old uri and not the manipulated):
> $r->uri($new_uri);
> $r->headers_out->add('Location' => ($new_uri));
>
> return Apache2::Const::REDIRECT;
>
>
> Any inputs are appreciated.
>
> Thanks,
> Nitin
>
Attachments: smime.p7s (2.32 KB)


nitin.chawke at ge

Jul 10, 2005, 12:13 PM

Post #3 of 4 (327 views)
Permalink
RE: Forwarding manipulated URI [In reply to]

Thanks.
yes... I thought so..
but the second way I was trying is :
$r->uri($new_uri);
$r->headers_out->add('Location' => ($new_uri));

return Apache2::Const::DECLINED;

Thanks anyways..
nitin

-----Original Message-----
From: Jonas Alves [mailto:jonas.alves [at] co]
Sent: Saturday, July 09, 2005 10:01 PM
To: Chawke, Nitin (Corporate, consultant)
Cc: modperl [at] perl
Subject: Re: Forwarding manipulated URI


I don't see any diferences in the tow ways you are showing. :)
But no, there is no way to change the browser url without redirecting
the request.

--Jonas

On 10 de jul de 2005, at 01:41, Chawke, Nitin (Corporate, consultant)
wrote:

> Hi All,
> I am using mod_perl's PerlTransHandler for manipulating the request
> URI.
> And forwarding the manipulated URI. I am getting the desired result
> page in the response, but the browser url does not change to the
> redirected page. But if I do a request redirect after manipulating the

> URI, the chagned uri does show up in the browser. Is there any way I
> would manipulate the URI, get the response with the manipulated URI,
> change the browser URL without actually redirecting the request.
>
> This is the code that I am using:
> $r->uri($new_uri);
> $r->headers_out->add('Location' => ($new_uri));
>
> return Apache2::Const::REDIRECT;
>
> This solves the purpose.
>
> But I want to use something similar to below (this shows the page but
> the browser URL shows the old uri and not the manipulated):
> $r->uri($new_uri);
> $r->headers_out->add('Location' => ($new_uri));
>
> return Apache2::Const::REDIRECT;
>
>
> Any inputs are appreciated.
>
> Thanks,
> Nitin
>


gozer at ectoplasm

Jul 20, 2005, 3:08 PM

Post #4 of 4 (292 views)
Permalink
Re: Forwarding manipulated URI [In reply to]

Chawke, Nitin (Corporate, consultant) wrote:
> Thanks.
> yes... I thought so..
> but the second way I was trying is :
> $r->uri($new_uri);
> $r->headers_out->add('Location' => ($new_uri));
>
> return Apache2::Const::DECLINED;

You are probably looking for:

$r->internal_redirect($new_uri);
return Apache2::Const::OK;

See :
http://perl.apache.org/docs/2.0/api/Apache2/SubRequest.html#C_internal_redirect_

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
Attachments: signature.asc (0.25 KB)

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.