xxxxxxxxxx
<?php
// Perform a location redirect in PHP
$url = "https://example.com/new-location"; // The URL you want to redirect to
// Use HTTP response headers to perform the redirect
header("Location: " . $url);
exit(); // Stop further execution after the redirect
?>
xxxxxxxxxx
//PHP redirect
header("Location: https://www.codegrepper.com/my-redirect-page.php");
die();
xxxxxxxxxx
//PHP redirect
header("Location: https://www.codegrepper.com/my-redirect-page.php");
die();
xxxxxxxxxx
function Redirect($url, $permanent = false)
{
header('Location: ' . $url, true, $permanent ? 301 : 302);
exit();
}
Redirect('http://example.com/', false);
xxxxxxxxxx
header("location: THE LOCATION"); //"THE LOCATION", put in a URL or directory to redirect to. For example, header("location: https://google.com/"); or header("location: ../../images/dog/");
xxxxxxxxxx
<% String redirectURL = "http://domain.com/";
response.sendRedirect(redirectURL); %>