Either have a copy of the header for just the pages that dont need redirection (like password reset) or add a flag kind of parameter to the header that will disable the redirection.