rules: add [?&] prefix to query match, use {0} instead of {} for 2.6
compatibility