Plack::Middleware::TrailingSlash - Append a trailing slash to GET requests whenever it is missing
builder { enable 'TrailingSlash'; };
Redirect to a path containing the trailing slash if the path looks like a directory
The Catalyst Perl MVC framework matches the requested URL to an action both with and without the trailing slash. For example both /company/contact and /company/contact/ go to the same action and same template.
This module redirects the requests without the trailing slash (ie. /company/contact) to the same URL with the trailing slash added (ie. /company/contact/).
Redirects are done permanently to avoid duplicate content in search indexes, but is given a max age of 3600 to prevent browsers from caching the redirect indefinitely.
A string or an array reference with a list of paths to ignore the trailingslash handling.
builder { enable 'TrailingSlash', ignore => [qr/^\/foobar\//]; }; builder { enable 'TrailingSlash', ignore => [ qr/^\/foobar\//, qr/^\/lolcat\// ]; };
Plack::Middleware Plack::Middleware::TrailingSlashKiller
Oskari Ojala <oskari.ojala@frantic.com> Josep Roca
Copyright 2013-2015 - Oskari Ojala
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Plack::Middleware::TrailingSlash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::TrailingSlash
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::TrailingSlash
For more information on module installation, please visit the detailed CPAN module installation guide.