Redirect issue to new page

Hi,
Thanks for the reply but i tried all possible way of using the URi Interface but still its not redirecting same above code if-else block with few try

if($email_id !=‘abc@gmail.com’ && $pass_id != ‘pass’) // Ignore the Condition. Please check the Else Block
{
$response_json = array(“error”=>1); //Username and Password Doesnt Match

        }
    else
        {	$response_json = array("error"=>2 );			// Username and Password Match
  	/*return $response->withRedirect('/home.php', 301);
  	die();*/
  	// $app->redirect('home'); 
  	// return $response->withStatus(301)->withHeader('Location', '/home.php');
  	// die();
  	/*header("Location:  http://www.abc.com/thankyou.php?msg=1");
  	 die();*/
                  $uri = new Uri('http://www.abc.com/home.php'); // **its a new page redirection**
                  $request = (new Request())->withMethod('GET')->withUri($uri)->withHeader('Accept', 'application/json');
               /* $response->withUri(UriInterface $uri, $preserveHost = false);*/
                 return $response->withRedirect((string)$request->getUri());
        }

Tried all possible way without any success … :frowning: