Make sure trailing and leading slashes do not collide