fix 301 redirect bug