// 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>';
?>
<?php
echo "<script>window.location.href='target.php';</script>";
exit;
?>
// add this lines in .htaccess file
php_value display_errors 1
php_flag output_buffering on
<?php
//No spaces can be left in the header.
//Location : => Location: | this may be your fault
$url = "";
header("Location: " . $url);
?>
header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP