//PHP redirect header("Location: https://www.codegrepper.com/my-redirect-page.php"); die();
< ?php header("Location: http://www.redirect.to.url.com/"); ?>
<?php /* This will redirect to facebook.com */ $url = "https://facebook.com.com"; header("Location: $url"); exit; ?>
header("Location: http://example.com/redirect_page.php"); die(); //Force the script to quit, or you would raise an error...
header("Location: /"); exit();
header("Location: http://example.com/myOtherPage.php"); die();
<html> <?php /* This will give an error. Note the output * above, which is before the header() call */ header('Location: http://www.example.com/'); exit; ?>
//Write this in the Controller when working on Laravel. header('Location: http://www.example.com/'); exit;
header("Location: " . "http://" . $_SERVER['HTTP_HOST'] . $location);