We help IT Professionals succeed at work.

url with slash "/" at the end

Hi,
How can I add slash to the end of url so it would look like
view-review/sth-here/ instead of
view-review/sth-here

Thanks!
Router::connect('/view-review/:rurl/*',
                        array('controller' => 'reviews', 'action' => 'view'),
                        array('pass' => array('rurl'),
                              'rurl' => '[\w-]+'));

Open in new window

Comment
Watch Question

Note 100% sure but does your Router::connect function redirect the user to that url?
If so have you tried .htaccess to automaticly add the slash?
The following should give you effect and theres a couple example exceptions in there for html and css pages too.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.html$
RewriteCond %{REQUEST_URI} !.css$
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ %{REQUEST_URI}/ [R=301,L]
Sorry, meant to type "Not", not "Note".