strip chars from end of url