package MyApp::Controller::Root; use strict; use warnings; use parent 'Catalyst::Controller'; __PACKAGE__->config->{ 'namespace' } = ''; sub auto : Private { my ( $self, $c ) = @_; if ( $c->request->path !~ m{/$} ) { $c->response->redirect( $c->request->path.'/' ); return 0; } return 1; }
I could have sworn there was a plugin out there to do this, but I can't seem to find it now...
In reply to Re: Catalyst - Add Trailing Slashes to URLs
by jasonk
in thread Catalyst - Add Trailing Slashes to URLs
by Sixtease
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |