Login Page server side validation

Sir, we have rendered the page on the login.html page itself if the password is incorrect and if the user does not exist we are rendering to the register.html page but we are getting an error page instead of login.html, register.html