By requiring a trailing / then removing it before ANDing with the “real” RewriteRule, you’ve twisted the logic - and likely introduced the failure point which you must be dealing with.
The dot character (in a character range definition) is NOT a meta-character and does NOT need (and should NOT be) escaped.
You would NOT succeed without ; or } at the end of a PHP statement or block statement so I get upset with people think that the Last flag can be omitted. It’s just not logical (to me). Note: Had your first RewriteRule used a Last Flag, it would NOT have been ANDed with the second - it IS important!
Just my preference: I will try to specify exactly what is allowed rather than what is not allowed, i.e., [a-z]+ rather than [^/.]+ to allow only lowercase letters. That will eliminate some error checking in the view.php script before querying the db but it makes the mod_rewrite code do some error checking for me.
Thank you for your reply it’s much appreciated, I’ll check it out.
Unfortunatley this was a project I took over so this code was already in place, you should see the code in the rest of the application, it’s a shambles!!