Redirect php page To Another web page URL using PHP header loaction redirect script-php redirection

You can easily redirect php page to the different web page using PHP header() function

the following PHP script redirect the user to rajeshstutorials.blogspot.com
<?php
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
?>

The header() is used to send a raw HTTP/1.1 specification specific header.
header() must be called before any actual output is sent,
below redirect script will NOT work, the browser received the HTML tag before the script
<html>
<?php
    header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
?>
make sure,it will not work if you sent any data to the browser before this function.

if you write echo or print or any HTML statements or before the website redirection you will get an error,to avoid this use PHP output buffering as follows

<?php
ob_start();
echo 'php header Location Script';
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
ob_flush();
?>