Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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!

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 chanting in the Monastery: (8)
As of 2016-10-01 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (6 votes). Check out past polls.