handle more situation in redirect rules.