Moved HTTPs redirection to middleware