Add logic for 301 redirect (#47)