a little more flexible url replacer