[Catalyst] Changing a base url in mod_perl

Ovid publiustemp-catalyst at yahoo.com
Sat Dec 31 01:18:25 CET 2005


--- Matt S Trout <dbix-class at trout.me.uk> wrote:

> Hmm. I'd vote for
> 
> $c->session->{referer} ||= $c->uri_for($c->req->path);
> 
> and then just
> 
> $c->res->redirect( $c->session->{referer} );

That definitely got me a lot closer.  As it turns out, I used

  $c->session->{referer} ||= $c->req->referer;

And it worked.

For some strainge reason, $c->uri_for($c->req->path) was turning the
path of "search/some/params" into
"http://www.example.com/catalyst/search/search/some/params" (in other
words, 'search' was getting doubled).

Cheers,
Ovid

-- 
If this message is a response to a question on a mailing list, please send follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/



More information about the Catalyst mailing list