xxxxxxxxxx
// If header throws an error - use this as temp solution.
<?php
echo '<script type="text/javascript">
location.replace("https://your_replaced_url_location_goes_here.com/"); </script>';
?>
xxxxxxxxxx
<?php
echo "<script>window.location.href='target.php';</script>";
exit;
?>
xxxxxxxxxx
<?php
// Make sure output buffering is turned off
ob_end_clean();
// Set the desired location for redirection
$location = 'http://example.com/new-page.php';
// Use the header function to send a redirect header
header("Location: $location");
exit;
?>