Removes slashes from start and end of path_info to ensure consistent segment access