This isn't actually stripping duplicate slashes, the star segment contains "folder1/folder2/folder3/" then the '/' separator, then the static segment "the-extra-stuff"