Avoid PHP warning and bad redirection