Fix to keep query string intact when 301 redirect occurs.