history: url matching improvements