Moved the conditionals to the init hook due to some edge cases not redirecting.