Extend to URLs with ?query=string as well as #hash