Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Catalyst - Add Trailing Slashes to URLs

by jasonk (Parson)
on Dec 04, 2008 at 04:45 UTC ( #727868=note: print w/ replies, xml ) Need Help??


in reply to Catalyst - Add Trailing Slashes to URLs

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...


www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!


Comment on Re: Catalyst - Add Trailing Slashes to URLs
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://727868]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-08-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (178 votes), past polls