Updated rewrite rule to handle trailing slash.