[backend] publish: support regexps for redirect, support redirect functions