Updated to handle missing leading slashes and removing trailing slashes to improve usability and consistency with PathMatcher