Thanks! I updated the code to only redirect for 301,302,303, 307, 308.