fix url replacing when matching a partial url