Removing the HTML comment  (<!-- User Authentication -->)and space that was messing up the redirects

You cannot have any thing in the html document before the php code that
will do the redirect since the browser will interpret this as the page
needing to be downloaded and not just the headers.