I need to include an optional trailing forwardslash, that's an /, in my RewriteRule
What I have so far is
RewriteRule ^([a-zA-Z0-9]+)$ u.php?$1|$2
Which works fine, for example http://foo.bar/abcde will redirect to http://foo.bar/u.php?abcde and handles any querystring parameters that may be present.
What I need to do is take http://foo.bar/abcde/ (with the trailing forwardslash) and redirect to http://foo.bar/u.php?abcde
So, if its present, I need remove the final forward slash from $1 in my RewriteRule. How do I do this? I'm new to apache and have tried many different regex rules but can't get it right.