Hello,
I am trying to rewrite the requested uri in order to remove the first
argument. For example:if I request http://localhost:3000/blog it calls
MyApp::C::Blog::index
I want the requested uri http://localhost:3000/bg/blog also to call the
same controller.
In other words I just want to remove the /bg/ at the beginning.
I tried this:

sub default : Private {
    my ( $self, $c ) = @_;
   if ($c->req->path =~ m/^(bg)\/?/i) {
      $c->req->path =~ m/^(bg)\/?(.*)$/i;

      my $rest_uri = $2;

      $c->detach('/' .$rest_uri . '/index');
    }
}

But it works only if the component has index.
I need some way to build the action from the modified string of the
requested uri.

Thanks in advance.
Best regards,
Anton Katsarov



_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to