Committing previous sites redirectmsd functionality. Code is super ugly, will refactor existing functionality before deciding whether to improve.