Just put /?in front of $the end of your template:
RewriteRule ^([a-zA-Z0-9]+)/?$ u.php?$1
But I would prefer that you allow only one spelling (with or without a trailing slash) and redirect another:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ /$0/ [L,R=301]
Gumbo source
share