remove trailing slash if the url points to a non-existing folder